Upload Creative Image

Upload image assets for building a creative for a specific advertiser

📘

URL: ​POST /api/v1/assets/photo

Form-Data Properties

ParameterDescriptionTypeRequiredPossible Values
fileThe binary data for the suitable image file demonstrating your creativefileYThe file should be:
  • Any image file of the format: jpeg/png
  • Max file size 10 mb
  • Max dimensions 5000px*5000px
assetTypeIdentifies the type of photo asset as either an image or logo. CP UI will use this to populate the Photos and Logos tabs.stringYValues: image, logo
Default value: image

Note: Please find Ad Unit Image Dimensions here

Request Parameters

ParameterDescriptionTypeRequiredPossible Values
advertiserId ID of the advertiserintegerYValid advertiser ID

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
Content-TypeFormat of the message bodyYapplication/json
WM_CONSUMER.IDUnique ID for consumer. We 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_SIGNATURESignature for authenticationYUse the signature generator code from Getting Started Guide to generate this value
WM_SEC.KEY_VERSIONKey version. We 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

Note: advertiser_id is serving as header parameter in this request. This header is X-Advertiser-ID. If You pass a request with headers like advertiserId=123, the request will fail.

Sample Request


curl -X POST \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/assets/photo' \ --header 'X-Advertiser-ID: <advertiser_id>' \ --header 'Content-Type: multipart/form-data' \ --header 'Authorization: Bearer <auth_token>' \ --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' \ --form 'assetType=logo' \ --form 'file=@"/test-image.jpeg"'

Response

FieldDescriptionOptional field/Nullable?TypePossible values
codeThe response code can have following values:<ul><li>success</li><li>failure</li></ul>
Click here for more information about Status Codes and Errors
Ystringsuccess, failure
assetIdIdentifier for the image uploaded. Use assetId to use this image while building creatives

Only returned when code=success
string
detailsList of error codes associated with the request. Use these codes for programmatic error handling.NarrayRefer to this link for detailed error messages
messageHigh-level summary of the error, when available. Ystring 
errorsDetailed information about one or more errors, including the affected field (when applicable), error code, and a human-readable description.Yarray<object> 

errors Array Object Details

FieldDescriptionOptional field/Nullable?TypePossible values
fieldJSON field associated with the error. Omitted if the error applies to the request as a whole.Ystring 
errorTypeMachine-readable error code that uniquely identifies the error condition. Applications should use this value for error handling logic.Nstring 
descriptionHuman-readable explanation of the error, including why the request failed and, when possible, how to resolve itNstring 

Sample Response - Success

[ { "code": "success", "details": ["success"], "assetId": "123d567-g7ty" } ]

Sample Response - Failure

[ { "code": "failure", "details": [ "string" ],    "message": "string",
    "errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }
]

Did this page help you?