Video Upload
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 HTTPS POST request to the API endpoint described at Video Upload documentation. Upon successful video upload, you will receive a VideoUrl.
- EX: POST
https://[stg]media.api.bazaarvoice.com/data/uploadvideo.json
- 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 200 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 VideoUrl
{
"Video": {
"VideoId": "3462b5d1-a387-4626-8904-95a9e296da73",
"VideoHost": "BAZAARVOICE",
"VideoThumbnailUrl": "https://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/thumbnail/image-00001.png",
"VideoUrl": "https://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/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 VideoUrl, provided in the response to a successful video upload, with the primary content.
Video can be linked with the review using both Full Submission and Progressive Submission.
Full Submission
To execute the following cURL command it may be necessary to modify the UserId
or UserNickname
parameters.
curl https://[stg].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 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://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/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
.This is usually the title of the video given by consumer.
Progressive Submission
Progressive Submission is comprised of the following two endpoints: initiateSubmit and progressiveSubmit
- initiateSubmit
The initiateSubmit endpoint is used to request product info for building review submission form(s). This action must be done with an HTTP POST. More details on initiateSubmit here.
POST /data/initiateSubmit.{FORMAT}?passkey={CONVERSATIONS_API_PASSKEY}&apiVersion={latestApiVersion} HTTP/1.1
Host: [stg.]api.bazaarvoice.com
Content-Type: application/json
X-Forwarded-For: [AuthorIPAddress]
…
{
"locale": "en_US",
"userToken": "{SOME_USER_TOKEN}",
"productIds": [
"Product1",
"ProductZ"
]
}
Ellipses (…) in above example indicate that your app may generate other headers.
Response format
{
"hasErrors": false,
"response": {
"userNickname": "test123",
"productFormData": {
"product1": {
"review": {
"submissionID": "r229778_17131768kMu31S9pzRvvvftv",
"productExternalID": "product1",
"submissionTime": "2024-04-15@10:26:40"
},
"fieldsOrder": [
"videourl_1",
"videocaption_1",
],
"fields": {
...
"videourl_1": {
"id": "videourl_1",
"type": "url",
"class": "videourl"
},
"videocaption_1": {
"id": "videocaption_1",
"type": "text",
"class": "videocaption"
}
}
},
"submissionSessionToken": "RsVCLU9SzhI5TfRKQd1eJi7//ao5v2pV2+Ui/NlU1TM6nnoyrjI7WV4guUx0y3FNCuMuQBPgu2+BIhTI7/QR64D+24m54XmseLYINfW3duw="
}
}
}
}
- progressiveSubmit
curl -L -X POST 'https://stg.api.bazaarvoice.com/data/progressiveSubmit.json?apiVersion=5.4&action=submit&passkey=your_API_Key' \
-H 'Content-Type: application/json' \
--data-raw '{
"locale": "en_US",
"productId": "product1",
"useremail": "[email protected]",
"userToken": "015b29e3c80faf74172228eee0a7756f646174653d3230323231303130267573657269643d726d6f68616e26656d61696c616464726573733d726d6f68616e25343062762e636f6d26757365726e616d653d726d6f68616e266d61786167653d333635267375626a6563746964733d70726f6475637431",
"submissionSessionToken": "RsVCLU9SzhI5TfRKQd1eJi7//ao5v2pV2+Ui/NlU1TM6nnoyrjI7WV4guUx0y3FNCuMuQBPgu2+BIhTI7/QR64D+24m54XmseLYINfW3duw=",
"submissionFields": {
"rating": "4",
"title": "Video Testing",
"reviewtext": "Stg_videoSubmission testing for progressive endpoint for video upload_Testing",
"agreedtotermsandconditions": "true",
"usernickname": "test123",
"videourl_1": "https://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/video/movie.mp4",
"videocaption_1": "testing site auth video caption"
}
}'
Note: The above cURL command uses the videocaption_1
parameter to associate a caption with videourl_1
.This is usually the title of the video given by consumer.
Response to Review after video upload
Requesting reviews using a filter and returning videos for a particular product
https://stg.api.bazaarvoice.com/data/reviews.json?apiversion=5.4&passkey=caB45h2jBqXFw1OE043qoMBD1gJC8EwFNCjktzgwncXY4&Filter=ProductId:data-gen-moppq9ekthfzbc6qff3bqokie&Filter=HasVideos:eq:true
To comply with WCAG 2.1 Accessibility standards, we recommend adding Closed Captions to your videos. Bazaarvoice automatically generates closed captions using 3rd party for the natively ingested videos and make it available via VideoCaptionUrl attribute in the reviews.json.
Response format
{
"Limit": 10,
"Offset": 0,
"TotalResults": 13,
"Locale": "en_US",
"Results": [
{
Id": "53829050",
"CID": "df783c01-f1fc-500e-8608-d4f4a57fc309",
"SourceClient": "conciergeapidocumentation",
...
"Videos": [
{
"VideoCaptionUrl": "https://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/video/movie.vtt",
"VideoId": "3462b5d1-a387-4626-8904-95a9e296da73",
"VideoHost": "BAZAARVOICE",
"VideoThumbnailUrl": "https://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/thumbnail/image-00001.png",
"VideoIframeUrl": null,
"Caption": "Test",
"VideoUrl": "https://stgvideo.api.bazaarvoice.com/3462b5d1-a387-4626-8904-95a9e296da73/video/movie.mp4}
],
...
}
],
"Includes": { },
"HasErrors": false,
"Errors": [ ]
}
Distinction Between "Caption" and "VideoCaptionUrl":
Caption: This attribute is user-generated and typically represents the title of the video, as entered by consumers in videocaption_1.
VideoCaptionUrl: This attribute refers to the link of an AI-generated .vtt caption file. This link is automatically provided for R&R videos.
Key Considerations on Closed Captions(CC)
- CC will not be moderated. However, all videos are moderated by humans.
- CC won’t be generated for YouTube or other streaming websites hosted videos.
- CC will be available for native and syndicated review videos
- CC will be available for Approved and Rejected review videos
- Localisation of captions is not supported
- Translation of captions is not supported.
- Transcription of non-verbal sounds/audio is not supported
Updated about 1 month ago