Upload Custom Image to Sponsored Brands Profile for Campaign

Upload an optional custom image to a Sponsored Brands campaign using this endpoint.

📘

URL: ​POST/api/v2/sba_custom_image_upload

Note: Custom images are optional and not mandatory for Sponsored Brands campaigns. This feature is not live and is available only in sandbox for testing.

Request Parameters

ParameterNotesTypeRequiredPossible Values
SBABaseProfileRequestJSON object to specify the campaignId and adGroupId for uploading the custom image.

SBABaseProfileRequest contains the following parameters:
campaignId: identifier of the campaign, data type integer.
adGroupId: identifier of the ad group, data type integer
sbaProfileId: identifier of the Sponsored Brands Profile, data type integer
string, JSON ObjectYExample:

{"campaignId": 1833448856,"adGroupId":771685004,"sbaProfileId":4437021}
fileFile path to the custom image file.stringYThe selected image must meet the following requirements:
  • File format: JPG or PNG
  • Maximum file size: 1MB
  • Aspect ratio: 16:9
  • Dimensions: Minimum of 1200x628px or larger

Custom Image Requirements

  • File format: JPG, PNG
  • Maximum file size: 1MB
  • Aspect ratio: 16:9
  • Dimensions: 1200x628px or larger
  • Image content: No text, graphics or logos

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

curl -X POST \ "https://developer.api.walmart.com/api-proxy/service/WPA/Api/v1/api/v2/sba_custom_image_upload" \ --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' \ --header 'Content-Type: application/json' \ --form 'SBABaseProfileRequest="{\"campaignId\": 1234567890,\"adGroupId\":777777777,\"sbaProfileId\":4444444}"' \ --form 'file=@"/Users/xxxxxx/Library/Containers/.../custom_image_example.png"'

Response

ElementDescriptionType
codeThe response code can have following values:  success, failure

Click here for more information on API Status Codes and Errors
string
detailsDetails of the error if value of response code is failure. See examples of details specific to custom image upload in Failure Responses.string
sbaProfileIdID of the Sponsored Brands profile associated with the custom imageinteger

Sample Response

{ "sbaProfileId": 4444444, "code": "success", "details": ""
}

Failure Responses

{ "sbaProfileId": 0, "code": "failure", "details": "Missing SBABaseProfileRequest /"
}
{ "code": "failure", "details": "Missing file /", "sbaProfileId": 0
}
{ "code": "failure", "details": "AdGroup Id validation failed / ", "sbaProfileId": 0
}
{ "code": "failure", "details": "Campaign Id validation failed / ", "sbaProfileId": 0
}
{ "code": "failure", "details": "Sba Profile Id validation failed / ", "sbaProfileId": 0
}
{ "code": "failure", "details": "Campaign not found.", "sbaProfileId": 0
}
{ "code": "failure", "details": "AdGroup not found.", "sbaProfileId": 0
}
{ "code": "failure", "details": "SBA Profile details not found for AdGroup 771685004", "sbaProfileId": 0
}
{ "sbaProfileId": 0, "code": "failure", "details": "Image sizes should be less than 1MB. Please update the image size and try again. / "
}
{ "sbaProfileId": 0, "code": "failure", "details": "File formats should be JPEG or PNG. Please update the file format and try again. /"
}
{ "sbaProfileId": 0, "code": "failure", "details": "The image ratio should be 16:9. Please update the image ratio and try again. /"
}
{ "sbaProfileId": 0, "code": "failure", "details": "The image dimension should be 1200 x 628 pixels or above. Please update the image dimension and try again. / "
}