Update AdSet Banner
The Update AdSet Banner API allows users to attach existing banner / video display ads, or create and attach new banner / video display ads to an adset, providing flexibility in adset management.
warning
It is important to handle adset data securely and ensure that access is restricted to authorized users only.
API Endpoint
Method: POST
URL: https://<PA_RM_END_POINT>/retail-media/adsets/{adsetId}/update-banner
info
Please refer to the Supplier API documentation for detailed instructions on how to retrieve the supplierId
.
Request Header
Name | Value |
---|---|
Content-Type | application/json |
Authorization | Bearer ACCESS_TOKEN |
Request Parameters
Parameter | Type | Description |
---|---|---|
adsetId | GUID | Id of the adset to update |
Example Request Payload
{
"bannerId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"banner": {
"name": "bannerName",
"imageUrl": [
{
"deviceType": "Desktop",
"url": ""
},
{
"deviceType": "Mobile",
"url": ""
},
{
"deviceType": "Tablet",
"url": ""
}
]
}
}
Parameter | Type | Required | Description |
---|---|---|---|
bannerId | GUID | conditionally optional | Existing bannerId. If bannerId is provided, system will update the adset banner / video using this bannerId. |
banner | object | conditionally optional | Banner / video details. If bannerId is not provided, the system will create a new banner / video using this banner / video information and update the AdSet banner / video accoringly. |
IMPORTANT
- If bannerId is provided → The system updates the AdSet using the specified bannerId.
- If a banner or video object is provided (without bannerId) → The system will create a new banner and update the AdSet accordingly.
- Requirement: At least one of bannerId or banner / video must be provided.
- AdSet Type: Must be Sponsored Display.
Response Payload
Success Response
- Status Code:
200 OK
- Payload: Returns the success message of the operation in JSON format
{
"status": "success",
"message": "Banner successfully attached to the AdSet",
"adSetId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Error Response
If an error occurs, the API will return an appropriate status code along with an error message.
- Sample Error Response (400 Bad Request):
{
"errors": [
"Error message 1",
"Error message 2"
],
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "xxxxxxxxxxxxxxxxxxx"
}
Example Usage (JavaScript)
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "BEARER YOUR_ACCESS_TOKEN");
const body = JSON.stringify(
{
"bannerId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"banner": {
"name": "bannerName",
"imageUrl": [
{
"deviceType": "Descktop",
"url": ""
},
{
"deviceType": "Mobile",
"url": ""
},
{
"deviceType": "Tablet",
"url": ""
}
]
}
}
)
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: body
};
fetch("https://<PA_RM_END_POINT>/retail-media/adsets/{adsetId}/update-banner", requestOptions)
.then(response => response.json())
.then(result=> {
console.log(result);
})
.catch(error => console.log('error', error));