Conversations API: Retrieve and submit consumer-generated content (CGC), and retrieve your product catalog and statistics about your CGC.
Video Upload
The Conversations API lets you programmatically retrieve and submit Bazaarvoice Conversations data for use in your applications. To learn more, go to the Conversations API documentation home page.
Contents
This tutorial covers how to perform video uploads using the Bazaarvoice Conversations API. Readers will learn about the video upload process and walk-through the steps involved in performing a video upload.
Overview
Video upload permits users to upload their own videos as part of submitting content allowing them to better express their experiences and assist other customers by showing them products in real-life scenarios.
Videos uploaded to the Bazaarvoice platform must be associated with a piece of primary content. This is accomplished through a two-step process:
- Video is uploaded to Bazaarvoice platform using an HTTP POST request to the API endpoint described at Video Upload documentation. Upon successful video upload, you will receive a Cloudfront URL.
- EX: POST
https://[stg]media.api.bazaarvoice.com/data/uploadvideo.json
- EX: POST
- Associate successfully uploaded video with one of the following primary content types during the submission process:
- Review
This two step process makes it possible to show users the results of a video upload before they complete the primary content submission. For example, a reviewer might upload videos while writing a review (step 1), and then see those videos in the context of the form before completing the review submission (step 2).
Submission guidelines
Video submission is subjected to the following:
- Size: Must not exceed 250 MB
- Supported File Formats: GP/3G2, ASF, AVI, DV, FLV, MOV, MP4/F4V, MPEG/MPG, QT, or WMV
- Only supported for reviews
- Only 1 video per review is allowed
- Your configuration must allow video upload as well. This can be enabled on Configuration Hub.
Walk-through
Step 1: Upload video to Bazaarvoice
Videos can be uploaded using the video file directly.
Video file
Switch to the directory of video file, and execute the following cURL command.
$ curl -F video=@your_video.mpeg -F apiversion=5.4 -F contenttype=Review -F passkey=your_API_Key https://[stg]media.api.bazaarvoice.com/data/uploadvideo.json
Response
This truncated response to a successful upload shows the Cloudfront URL.
{
"Video": {
"VideoId": "861f7833-1ef4-43a9-a214-43b8d06381ab",
"VideoHost": "BAZAARVOICE",
"VideoThumbnailUrl": "https://d2pg9tvqg9rw5b.cloudfront.net/861f7833-1ef4-43a9-a214-43b8d06381ab/thumbnail/image-00001.png",
"VideoUrl": "https://d2pg9tvqg9rw5b.cloudfront.net/861f7833-1ef4-43a9-a214-43b8d06381ab/video/movie.mp4"
},
...
"HasErrors": false
}
Step 2: Associate video with primary content
Once a video has been uploaded it can be associated with a piece of primary content. This is accomplished by submitting the Cloudfront URL, provided in the response to a successful video upload, with the primary content.
To execute the following cURL command it may be necessary to modify the UserId
or UserNickname
parameters.
$ curl https://[stg]media.api.bazaarvoice.com/data/submitreview.json?passkey=your_API_Key
-d apiversion=5.4
-d productId=product1
-d rating=5
-d reviewtext=Testing video submission in the review
-d title=Testing video submission
-d action=submit
-d usernickname=test1
-d agreedtotermsandconditions=yes
-d sendemailalertwhenpublished=true
-d user=015b29e3c80faf74172228eee0a7756f646174653d3230323231303130267573657269643d726d6f68616e26656d61696c616464726573733d726d6f68616e25343062762e636f6d26757365726e616d653d726d6f68616e266d61786167653d333635267375626a6563746964733d70726f6475637431
-d videourl_1=https://d1qs50umyh9pfn.cloudfront.net/7b23aabd-2fc8-4176-a6db-3e29428cabaa/video/movie.mp4
-d videocaption_1=testing site auth video caption
Note: The above cURL command uses the videocaption_1
parameter to associate a caption with videourl_1
Complete response to video upload
{ "Locale": "en_US", "Errors": [], "Form": [ { "Type": "Field", "Id": "video" } ], "Video": { "VideoId": "861f7833-1ef4-43a9-a214-43b8d06381ab", "VideoHost": "BAZAARVOICE", "VideoThumbnailUrl": "https://d2pg9tvqg9rw5b.cloudfront.net/861f7833-1ef4-43a9-a214-43b8d06381ab/thumbnail/image-00001.png", "VideoUrl": "https://d2pg9tvqg9rw5b.cloudfront.net/861f7833-1ef4-43a9-a214-43b8d06381ab/video/movie.mp4" }, "FormErrors": {}, "SubmissionId": null, "Data": { "Fields": { "video": { "Options": [], "Type": "FileInput", "Required": null, "Label": null, "Value": null, "MinLength": null, "Id": "video", "MaxLength": null, "Default": null } }, "Groups": {}, "FieldsOrder": [ "video" ], "GroupsOrder": [] }, "TypicalHoursToPost": null, "AuthorSubmissionToken": null, "HasErrors": false }