The Media API provides capabilities to upload, modify and fetch video assets.
Usage:
To create an allocation to upload a video asset and an optional closed caption file
To upload the video asset and closed Caption File to the uploadUrl
To accept the video upload notification
To fetch the video validation outcome by passing the mediaId of the video asset
To update the media file name
Limitations
Currently, we do not have the capability to delete the media file for an advertiser
We do not support previewing the video file
To understand details about ‘Request Header' or 'Authorization’,
please refer to the Authorization Guide
Upload Media
Description: The upload media endpoint is used to create a location to upload a video asset and an optional closed caption file (recommended if the video has spoken words). This location is short-lived and expires in 15 minutes.
End Point: /api/v1/media/upload
HTTP Method: POST
Query Parameters
Parameter
Description
Type
Required
Possible Values
advertiserId
ID of the advertiser, uploading video asset
Integer
Y
Unique numeric identifier
mediaType
The value of mediaType is “video”.
String
Y
Relevant string value representing the media type
Note: mediaType paramerter should be follow:
The file size must be less than 500 MB.
The file format must be .MP4 or .MOV
The aspect ratio should be 16:9.
The dimensions must be 1920 x 1080px – 3840 x 2160px.
The duration must be 5–30 seconds.
Video codec must be H.264 or H.265.
The audio codec must be AAC, MP3, PC.
Caption file format should be .srt or .vtt.
Currently, there is no restriction on the number of videos that an advertiser can upload for an advertiser account
Possible values of the response code: success or failure
String
details
Details of the error if response code is failure
String
mediaUploadRequestId
Id that is generated in response to receiving a request for uploading a video asset
Integer
uploadUrl
The URL to upload the media. Note: The URL expires in 15 minutes. The upload location only supports PUT HTTP method to upload the media content.
String
captionUrl
The URL to upload the closed caption file. Note: The URL expires in 15 minutes. The upload location only supports PUT HTTP method to upload the caption file.
Advertiser <advertiserId> is not allowed to use this feature
Advertiser Id: <advertiserId> is not eligible for this type of campaign. Please ensure that your brand is registered as an approved brand with brandportal.walmart.com before submitting this campaign create request.
You have exceeded the maximum number of 10 media upload requests per account. Please try again later.
You have reached the limit of 200 videos, please delete unwanted ones among videos that you own
403
Forbidden
User not authenticated
AdOps role does not access to any campaigns
You do not have write permission to this advertiser
Video ads feature is not enabled
429
Too Many Requests
<Exception Message>
500
Internal Server Error
There was an error processing the request
Upload the Media File to Upload Location
Description
Use this endpoint to
Upload the video asset to the uploadUrl
Upload the closed caption file to captionUrl. Upload of caption file is optional
Request body to include binary data of mp4 or .mov video file
If closed caption file upload successful – response 201
If closed caption file upload failure - generic error message
Complete Media Upload
Description
Use this endpoint to accept video upload notification
This endpoint is called once the media is uploaded to the location provided by the /api/v1/media/upload API endpoint
This API creates a media resource for the video asset. The media resource is represented by a media identifier. The media identifier can be used to associate the media with the adGroup for Sponsored Videos.
Once the media is uploaded, the API internally kicks off a background process for validating the technical specifications of the media file. As a result, the media may not be immediately available for use in a Sponsored Video campaign. See /api/v1/media endpoint to get details on when the media is available to be used in a campaign.
End Point: /api/v1/media/complete
HTTP Method: PUT
Query Parameters
Parameter
Description
Type
Required
Possible Values
advertiserId
The ID of the ad group. Required only if updating an existing ad group.
Integer
Y
Unique numeric identifier
mediaName
The title of the video is creative. The maximum file name size is 45 characters and no special characters are allowed.
String
Y
Relevant string value representing the name of the video asset
mediaUploadRequestId
ID that is generated in response to receiving a request for uploading a video asset.
You do not have write permission to this advertiser
You don't have access to this advertiser
404
Not Found
MediaDetails not found
429
Too Many Requests
<Exception Message>
500
Internal Server Error
There was an error processing the request
List All the Media
Description:
This endpoint is used to fetch the video validation outcome by passing the mediaId of the video asset. It polls Sam's Club system to check the video validation status and returns the result.
For a video asset to be associated with a campaign, the corresponding media file should be in AVAILABLE status. The AVAILABLE status guarantees that the background process has completed the processing of the video asset and that it is available for usage in a Sponsored Video campaign. The validated video asset represents the video profile.
The background processing can take approximately take ~30 minutes to complete. We recommend polling the system to check for the video validation 30 minutes after uploading, with a backoff timer of 15 minutes.
The endpoint can also be used to list all the video files along with their status for a given advertiser. Optionally, you can also filter by the status of the media file (PENDING, FAILED or AVAILABLE) to list only files matching the status for a given.
End Point: /api/v1/media
HTTP Method: GET
Query Parameters
Parameter
Description
Type
Required
Possible Values
advertiserId
The ID of the advertiser
Integer
Y
Unique numeric identifier
mediaId
The unique Id of the media file generated from the notify media upload complete call Note:When an advertiser id and multiple media ids are provided, the service shall return the media details qualifying for the first media id.
Integer
N
Unique numeric identifier
status
The value represents the status of the media file. Note:When an advertiser id and multiple status are provided, the service shall return the media details qualifying for the first status.
String
N
Relevant string value representing the status (PENDING, FAILED, AVAILABLE)