brightcove-axios
v1.0.6
Published
An axios wrapper for [Brightcove APIs](https://support.brightcove.com/getting-started-platform-apis)
Downloads
16
Readme
Brightcove axios
An axios wrapper for Brightcove APIs
Installing
$ npm install brightcove-axios
Usage
const { cmsApi } = require('brightcove-axios');
const bcRequestConfig = {
clientId: 'aaaaa-bbbbb-ccccc-dddd-eeeeee',
clientSecret: 'EXuoOigTEXfpd4iCJaaaFWKPreWjojtX7kQwG4Ne8QuBACaS37Hu0v8TpqEmYtLBLloSnegqtWJbC7dFj9RaHw',
};
const accountId = '5132399229001';
cmsApi.get(`/accounts/${accountId}/videos`, bcRequestConfig)
.then(response => console.log('CMS API response', response))
.catch(err => console.error('CMS API err', err));
Available APIs
const { cmsApi } = require('brightcove-axios');
const bcRequestConfig = {
clientId: 'aaaaa-bbbbb-ccccc-dddd-eeeeee',
clientSecret: 'EXuoOigTEXfpd4iCJaaaFWKPreWjojtX7kQwG4Ne8QuBACaS37Hu0v8TpqEmYtLBLloSnegqtWJbC7dFj9RaHw',
};
const accountId = '5132399229001';
cmsApi.get(`/accounts/${accountId}/videos`, bcRequestConfig)
.then(response => console.log('CMS API response', response))
.catch(err => console.error('CMS API err', err));
const { dynamicIngestApi } = require('brightcove-axios');
const bcRequestConfig = {
clientId: 'aaaaa-bbbbb-ccccc-dddd-eeeeee',
clientSecret: 'EXuoOigTEXfpd4iCJaaaFWKPreWjojtX7kQwG4Ne8QuBACaS37Hu0v8TpqEmYtLBLloSnegqtWJbC7dFj9RaHw',
};
const accountId = '5132399229001';
const postData = {
master: {
url: "http://learning-services-media.brightcove.com/videos/mp4/greatblueheron.mp4",
audio_tracks: [
{ language: "en", variant: "main" },
]
},
};
dynamicIngestApi.post(`/accounts/${accountId}/videos/${videoId}/ingest-requests`, postData, bcRequestConfig)
.then(response => console.log('Dynamic Ingest API response', response))
.catch(err => console.error('Dynamic Ingest API err', err));