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
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” Note:
| string | Y | Relevant string value representing the media type |
Headers
Header Name | Description | Required | Values |
---|---|---|---|
Authorization | The token will provide you the access to the API. It is same for all advertisers you access through the API. | Y | Please utilize the generated auth_token shared with you at the time of partner onboarding from the Getting Started Guide |
WM_CONSUMER.ID | We will provide you the consumer ID to access the API. It is same for all advertisers you access through the API. | Y | Please 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_SIGNATURE | Auth signature as an API key. | Y | Use the signature generator code from Getting Started Guide to generate this value |
WM_SEC.KEY_VERSION | We will provide you with the KEY VERSION to access the API. It is same for all advertisers you access through the API. | Y | 1 |
WM_CONSUMER.intimestamp | Timestamp for which the auth signature is generated. Use Unix epoch format for the timestamp. | Y | Use 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
Element | Description | Type |
---|---|---|
code | Possible values of response code: success, failure | string |
details | Details of the error if value of 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 | string |
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": "" }
]
Updated 15 days ago