Upload Media

The upload media endpoint is used to create a location to upload a video asset and an optional closed caption file (recommended to provide if video has spoken words). This location is short lived and expires in 15 minutes.

📘

URL: POST /api/v1/media/upload

Request Parameters

ParameterDescriptionTypeRequiredPossible Values
advertiserIdId of the advertiser, uploading video assetintegerYUnique numeric identifier
mediaType  The value of mediaType is “video”Note: • The file size must be ≤ 500mb• 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 secondsvideo codec must be H.264 or H.265audio codec must be AAC, MP3, PCM• Caption file format should be  .srt or .vtt• Number of media files associated with an advertiser account should not exceed the configurable limit owned by WMC. It is 200 currently. An error message will be returned if this number is exceeded.    stringYRelevant string value representing the media type

Headers

Header NameDescriptionRequiredValues
AuthorizationThe token will provide you the access to the API. It is same for all advertisers you access through the API.YPlease utilize the generated auth_token shared with you at the time of partner onboarding from the Getting Started Guide
WM_CONSUMER.IDWe will provide you the consumer ID to access the API. It is same for all advertisers you access through the API.   YPlease use the generated ConsumerId shared with you at the time of partner onboarding. Refer to the Getting Started Guide for more information
WM_SEC.AUTH_SIGNATUREAuth signature as an API key.YUse the signature generator code from Getting Started Guide to generate this value
WM_SEC.KEY_VERSIONWe will provide you with the KEY VERSION to access the API. It is same for all advertisers you access through the API.Y1
WM_CONSUMER.intimestampTimestamp for which the auth signature is generated. Use Unix epoch format for the timestamp.YUse the signature generator code from Getting Started Guide to generate this value

Sample Request 1

curl -X POST \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/media/upload' \
--header 'Authorization: Bearer <auth_token>' \ --header 'accept: application/json' \
--header 'WM_SEC.AUTH_SIGNATURE: ***********' \
--header 'WM_SEC.KEY_VERSION: 1' \ 
--header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \
--header 'WM_CONSUMER.intimestamp: 1565309779'\
--header 'Content-Type: application/json' \
--data '{ "mediaType": "video", "advertiserId": 500002 }'

Sample Request 2

curl -X POST \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/media/upload' \
--header 'Authorization: Bearer <auth_token>' \ --header 'accept: application/json' \
--header 'WM_SEC.AUTH_SIGNATURE: ***********' \
--header 'WM_SEC.KEY_VERSION: 1' \ 
--header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \
--header 'WM_CONSUMER.intimestamp: 1565309779'\
--header 'Content-Type: application/json' \
--data '{ "mediaType": "foo", "advertiserId": 500002 }'

Sample Request 3

curl -X POST \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/media/upload' \
--header 'Authorization: Bearer <auth_token>' \ --header 'accept: application/json' \
--header 'WM_SEC.AUTH_SIGNATURE: ***********' \
--header 'WM_SEC.KEY_VERSION: 1' \ 
--header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \
--header 'WM_CONSUMER.intimestamp: 1565309779'\
--header 'Content-Type: application/json' \
--data '{ "mediaType": "video", "advertiserId": 400001 }'

Response

ElementDescriptionType
codePossible values of response code: success, failure  string
detailsDetails of the error if value of response code is failure  string
mediaUploadRequestIdId that is generated in response to receiving a request for uploading a video assetinteger
uploadUrlThe URL to upload the media.Note: The URL expires in 15 minutes. The upload location only supports PUT HTTP method to upload the media contentstring
captionUrlThe 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 filestring

Sample Response 1

[ { "code": "success", "details": "", "mediaUploadRequestId": 600001, "uploadUrl": "https://b4e0184a3estg.blob.core.windows.net /video.mp4?sv=2021-08-06&se=2022-08- 19T05%3A05%3A23Z&sr=b&sp=rcwl&sig=DvVyinZhZo1gNahI%2BRobR4oxXMyXmQG8gD04ZraInoY%3D", "captionUrl": "https://b4e0184a3estg.blob.core.windows.net/caption.srt?sv=2021-08-06&se=2022-08- 19T05%3A05%3A23Z&sr=b&sp=rcwl&sig=1aVWrnICQAQGV7lZ3JDuL1W8gOkPOqLYLim6JtRN6X0%3D" }
]

Sample Response 2


[ { "code": "failure", "details": " Invalid Media Type /", "mediaUploadRequestId": 0 , "uploadUrl": "", "captionUrl": "" }
]

Sample Response 3

[ { "code": "failure", "details": " Advertiser 400001 is not allowed to use this feature", "mediaUploadRequestId": 0, "uploadUrl": "", "captionUrl": "" }
] 

Sample Response 4

[ { "code": "failure", "details": "You have reached the limit of 200 videos, please delete unwanted ones among 200 videos that you own.", "mediaUploadRequestId": 0, "uploadUrl": "", "captionUrl": "" }
]