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 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:
"sourceid": "amazing-video"
3.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.
- Set up authentication
- Return the associated media clip using the sapi/mediaclip endpoint
- Update the media clip meta data
3.1 | Authentication
- First set up an API key:
- Click to expand “Publication settings” in the left menu panel
- Click “API Keys”;..
- Click “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)
3.2 | Retrieve the associated media clip
{publication_name}.bbvms.com/sapi/mediaclip?q=sourceid:"{file_name_without_extension}"&rpctoken={secret_API_key_ID}-{calculated_token}
Example:
yourcompanyname.bbvms.com/sapi/mediaclip?q=sourceid:"my-first-upload"&rpctoken=123-0a1b2c3d4e
The expected result is a JSON containing the media clip meta data.
Read more about the mediaclip endpoint.
3.3 | Update metadata
Edit the JSON with the proper metadata 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.
Read more about the mediaclip endpoint.