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
Parameter | Notes | Type | Required | Possible Values |
---|---|---|---|---|
SBABaseProfileRequest | JSON 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 Object | Y | Example: {"campaignId": 1833448856,"adGroupId":771685004,"sbaProfileId":4437021} |
file | File path to the custom image file. | string | Y | The selected image must meet the following requirements:
|
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 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
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
Element | Description | Type |
---|---|---|
code | The response code can have following values: success , failure Click here for more information on API Status Codes and Errors | string |
details | Details of the error if value of response code is failure . See examples of details specific to custom image upload in Failure Responses. | string |
sbaProfileId | ID of the Sponsored Brands profile associated with the custom image | integer |
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. / "
}
Updated 5 days ago