Complete Media Upload
Description
Use this endpoint to accept video upload notification.
Call this endpoint 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 GET/api/v1/media
endpoint to get details on when the media is available to be used in a campaign.
URL: PUT /api/v1/media/complete
Request Fields
Parameter | Description | Type | Required | Possible Values |
---|---|---|---|---|
advertiserId | The ID of the advertiser | integer | Y | Unique numeric identifier |
mediaName | The title of the video creative Maximum file name size is 45 characters and no special characters allowed | string | Y | Relevant string value representing the name of the video asset |
mediaUploadRequestId | Id generated after receiving a request for uploading a video asset. | integer | Y | Unique numeric identifier |
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 further explanation on this |
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 (Getting Started Guide) to generate this value |
Sample Request
curl -X PUT \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/media/complete' \
--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 '{ "advertiserId": 500002, "mediaName": "sample-video", "mediaUploadRequestId": 600001 }'
Response
Element | Description | Type |
---|---|---|
code | Shows status of the ad group update operation Values: success, failure | string |
details | Details of the failure in case of video file/caption file validation error | string |
mediaId | The unique Id of the media file generated from the notify media upload complete call | integer |
errors | Error description in case of failure. It consists of: message (data type string), type(data type string), code(data type string) Please find video validation error codes and description in following table “Video Validation errors” | array |
Video Validation errors
Error Code | Error Description | Additional Information |
---|---|---|
E_BAD_VIDEO | Failed to decode video. | No additional message |
E_EMPTY_VIDEO | Video file is empty. | |
E_VIDEO_STREAM_COUNT | There must be exactly one video stream. | “The provided video had ” + videoStreams.size() + ” video streams.” |
E_WIDTH_NOT_POSITIVE | Video width should be greater than zero. | |
E_HEIGHT_NOT_POSITIVE | Video height should be greater than zero. | |
E_VIDEO_DURATION_NOT_POSITIVE | Video duration should be greater than zero. | |
E_BITRATE_KBPS_NOT_POSITIVE | Video bitrate kbps should be greater than zero. | |
E_FRAME_RATE_FPS_NOT_POSITIVE | Video frame rate fps should be greater than zero. | |
E_TIMESTAMP_FORMAT_INVALID | ||
E_TIMESTAMP_DURATION_INVALID | Invalid Video Timestamp Duration | |
E_VIDEO_URL | The service was unable to retrieve the video from the URL provided. | String.format(“Received error %d from %s.”, code, url) |
E_CALLBACK_URL | String.format(“‘%s’ is not a valid HTTP URL”, callbackUrl) | |
E_CALLBACK_NOT_ALLOWED | String.format(“The callback URL ‘%s’ cannot be used as the request is not intended for”+ ” transcoding.”,callbackUrl) | |
E_BAD_SOURCE | Source is invalid. | String.format(“‘%s’ is not a valid HTTP URL or a GCS URI”, source) |
E_ASPECT_RATIO | Video does not match aspect ratio requirement. | String.format(“%d:%d”, numerator, denominator) |
E_MAX_DURATION_SECONDS | Video is longer than max duration requirement. | String.format(“Value %s is greater than upper bound %s.”, value, limit) |
E_MIN_DURATION_SECONDS | Video is shorter than minimum duration requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_MAX_HEIGHT_PIXELS | Video is taller than max height pixels. | String.format(“Value %s is greater than upper bound %s.”, value, limit) |
E_MIN_HEIGHT_PIXELS | Video is shorter than minimum pixel height requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_MAX_WIDTH_PIXELS | Video is wider than maximum pixel width requirement. | String.format(“Value %s is greater than upper bound %s.”, value, limit) |
E_MIN_WIDTH_PIXELS | Video is narrower than minimum pixel width requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_MAX_FILE_SIZE_MB | Video file size is greater than max file size requirement. | String.format(“Value %s is greater than upper bound %s.”, value, limit) |
E_MIN_FILE_SIZE_MB | Video file size is less than minimum file size requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_MIN_AUDIO_BITRATE_KBPS | Audio bit rate is less than minimum audio bitrate kbps requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_MIN_VIDEO_BITRATE_KBPS | Video bitrate is less than minimum video bitrate kbps requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_MIN_FRAME_RATE_PER_SECOND | Video frame rate is less than minimum frame rate per second requirement. | String.format(“Value %s is less than lower bound %s.”, value, limit) |
E_SUPPORTED_CONTAINERS | Unsupported container. | “None of the container formats “+ String.join(“, “, containerNames)+ ” were in the list of supported container formats: “+ String.join(“, “, SUPPORTED_CONTAINERS)) |
E_SUPPORTED_VIDEO_CODECS | Unsupported video codec. | “Unsupported video codec “+ videoStream.codec_name+ “. The supported video codecs are: “+ String.join(“, “, SUPPORTED_VIDEO_CODECS)) |
E_SUPPORTED_AUDIO_CODECS | Unsupported audio codec. | “Unsupported audio codec “+ codecName+ “. The supported audio codecs are PCM codecs and: “+ String.join(“, “, SUPPORTED_AUDIO_CODECS)) |
E_BAD_CAPTION | Closed caption data is invalid. | Empty Closed caption found. |
FFProbe identified it as bad closed caption data. | ||
E_VTT_CAPTION | VTT closed caption data is invalid. | Couldn’t find blank line between header and content or content is empty. |
E_VTT_CAPTION_HEADER | VTT closed caption header data is invalid. | VTT Closed caption must starts with WEBVTT. |
E_VTT_CAPTION_HEADER_METADATA | Metadata in VTT closed caption header is invalid. | String.format(“Unrecognized header metadata ‘%s’.”, curMetaLine) |
E_CAPTION_CUE | Closed caption cue data is invalid. | String.format(“No timestamps found in Closed Caption cue ‘%s’.”, ccContent) |
E_CAPTION_CUE_ARROW | Arrow between two timestamps in closed caption cue data is invalid. | String.format(“Invalid arrow ‘%s’ in ‘%s'”, realArrow, line) |
E_CAPTION_FORMAT_NOT_SUPPORTED | Closed caption format not supported. | String.format(“Only SRT and VTT are supported. Current format ‘%s’.”, fileFormat) |
E_CAPTION_URL | The service was unable to retrieve the caption file from the URL provided. | String.format(“Received error %d from %s.”, code, url) |
E_MAX_CAPTION_FILE_SIZE_MB | Closed caption file size greater than max cc file size requirement. | String.format(“Value %s is greater than upper bound %s.”, value, limit) |
Sample Response 1
[ { "code": "success", "details": "", "mediaId": 600001, "errors": [ { "message": "message1", "type": "VALIDATION", "code": "E_ASPECT_RATIO" }, { "message": "message2", "type": "VALIDATION", "code": "E_MIN_PIXEL" } ] }
]
Sample Response 2
[ { "code": "success", "details": "", "mediaId": 12620, "errors": null }
]
Updated 4 months ago