Blue Billywig uses AWS S3 to store all video files on your account. Although the Online Video Platform (OVP) provides an easy-to-use interface for uploading video and audio content, it’s also possible to programmatically upload content directly to your account’s S3 bucket.
In this article you will learn how to upload your files directly to your account’s S3 bucket.
1.0 | Upload to S3 bucket
- Create AWS upload credentials to obtain the following details (learn more about creating AWS upload credentials).
- S3 access key id;
- S3 secret access key;
- S3 bucket name;
- Use the following upload path:
{bucket name}/upload/{account name}
Example:
“Awesome Company” has the following bucket name: mm.awesomecompany.bbvms.com. Therefore the path required for direct video/audio upload:
mm.awesomecompany.bbvms.com/upload/awesomecompany
2.0 | Connect an S3 upload to a media clip
Uploaded content needs to be associated with a media clip in the OVP (Online Video Platform) to add meta data to your content and publish it to your audience. When directly uploading to S3, your upload will automatically can be associated with either a new or an existing media clip in the OVP.
By default, the file name of the uploaded file is used to facilitate the connection. When the upload to S3 is finished, a new media clip is created with a ‘sourceid’ property that is set to the upload file name (without extension).
Example:
After a file “amazing-video.mp4” is uploaded, a new media clip is created with:
"sourceid": "amazing-video"
2.0 | Add/edit media clip meta data
There are two options for adding/editing the media clip meta data:
- Access the media clip in the OVP interface. Learn more about metadata in the OVP.
- Programmatically add/edit meta data by using our sAPI endpoints.
The rest of this article will explain the necessary steps for the latter option: updating the media clip meta data using your own custom implementation:
- Set up authentication
- Return the associated media clip using the sapi/mediaclip endpoint
- Update the media clip meta data
2.1 | Authentication
Authentication is required to run queries on the sapi/mediaclip endpoint. A time-based token is to be calculated and added to the request URL.
- First set up an API key:
- Go to the Publication settings;
- Select “API Keys” in the left menu panel and click “Create New Key”;
- Enter the API key “Label” (the “Description” field is optional)
- Select a role that determines the permissions of the API key (Learn more about API keys management)
- Click save to generate the “Secret” and “ID” value of the API key. Both values are required for authentication (read more about getting started with SAPI)
2.2 | Return the associated media clip
Perform a query on the sapi/mediaclip endpoint to search for the media clip with the file name (without extension) as its sourceid.
[publication_name].bbvms.com/sapi/mediaclip?q=sourceid:"[file_name_without_extension]&rpctoken=[secret_API_key_ID]-[calculated_token]
Example:awesomecompany.bbvms.com/sapi/mediaclip?q=sourceid:"amazing-video"&rpctoken=123-0a1b2c3d4e
The expected result is a JSON containing the media clip meta data.
2.3 | Update meta data
Edit the JSON with the proper meta data and perform a POST / PUT request to update the media clip. Keep in mind to apply the same authentication when performing a POST/PUT request on the sapi endpoints.