@42videobricks/nodejs-client

1.2.0 • Public • Published

@42videobricks/nodejs-client

Api42Vb - JavaScript client for @42videobricks/nodejs-client 42videobricks is a Video Platform As A Service (VPaaS) This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.2
  • Package version: 1.2.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @42videobricks/nodejs-client --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your @42videobricks/nodejs-client from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install 42videobricks/42videobricks-nodejs-client --save

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var Api42Vb = require('@42videobricks/nodejs-client');

var defaultClient = Api42Vb.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['x-api-key'] = "Token"

var api = new Api42Vb.VideosApi()
var opts = {
  'limit': 10, // {Number} Number of elements to return (default=10)
  'offset': 0 // {Number} offset for pagination
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getVideos(opts, callback);

Documentation for API Endpoints

All URIs are relative to https://api-sbx.42videobricks.com

Class Method HTTP request Description
Api42Vb.DataApi getDataVideoUsage GET /data/videos/usage List Video Usage KPIs
Api42Vb.PlaylistsApi addPlaylist POST /playlists Add a new playlist
Api42Vb.PlaylistsApi deletePlaylistById DELETE /playlists/{playlistId} Delete a playlist
Api42Vb.PlaylistsApi getPlaylistById GET /playlists/{playlistId} Retun a single playlist
Api42Vb.PlaylistsApi getPlaylists GET /playlists List playlists
Api42Vb.PlaylistsApi updatePlaylistById PUT /playlists/{playlistId} Update an existing playlist
Api42Vb.TagsApi getTags GET /tags List Video Tags
Api42Vb.VideosApi addAttachmentByVideoId POST /videos/{videoId}/attachments/{attachmentType}/{locale} Upload an attachement
Api42Vb.VideosApi addThumbnailByVideoId POST /videos/{videoId}/thumbnail Upload a thumbnail
Api42Vb.VideosApi addVideo POST /videos Add a new video
Api42Vb.VideosApi deleteAttachmentByVideoId DELETE /videos/{videoId}/attachments/{attachmentType}/{locale} Delete an attachment
Api42Vb.VideosApi deleteThumbnailByVideoId DELETE /videos/{videoId}/thumbnail Delete a thumbnail
Api42Vb.VideosApi deleteVideoById DELETE /videos/{videoId} Delete a video
Api42Vb.VideosApi finalizeMultipartUploadVideoById POST /videos/{videoId}/multipart-upload/finalize Multipart upload finalization
Api42Vb.VideosApi finalizeUploadVideoById PUT /videos/{videoId}/upload/finalize Single file upload finalization
Api42Vb.VideosApi getAttachmentByVideoId GET /videos/{videoId}/attachments/{attachmentType}/{locale} Get the attachment
Api42Vb.VideosApi getAttachmentFileByVideoId GET /videos/{videoId}/attachments/{attachmentType}/{locale}/file Get attachement file
Api42Vb.VideosApi getAttachmentsByVideoId GET /videos/{videoId}/attachments List of attachments
Api42Vb.VideosApi getVideoById GET /videos/{videoId} Retun a single video
Api42Vb.VideosApi getVideoStatusById GET /videos/{videoId}/status Retun the detailed status of the video
Api42Vb.VideosApi getVideos GET /videos List videos
Api42Vb.VideosApi initMultipartUploadVideoById POST /videos/{videoId}/multipart-upload/init Multipart upload intialization
Api42Vb.VideosApi initUploadVideoById GET /videos/{videoId}/upload/init Single file upload intialization
Api42Vb.VideosApi updateVideoById PUT /videos/{videoId} Update an existing video
Api42Vb.WebhooksApi addWebhook POST /webhooks Add a new webhook
Api42Vb.WebhooksApi deleteWebhookById DELETE /webhooks/{webhookId} Delete a webhook
Api42Vb.WebhooksApi getWebhookById GET /webhooks/{webhookId} Retun a single webhook
Api42Vb.WebhooksApi getWebhooks GET /webhooks List webhooks
Api42Vb.WebhooksApi updateWebhookById PUT /webhooks/{webhookId} Update an existing webhook

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

api_key

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

/@42videobricks/nodejs-client/

    Package Sidebar

    Install

    npm i @42videobricks/nodejs-client

    Weekly Downloads

    2

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    303 kB

    Total Files

    34

    Last publish

    Collaborators

    • bastien-alchimie
    • laurent-alchimie