Placements
Overview
Placement API provides the capability to fetch, add or update placements
Usages:
- Get a list of all the campaign placements
- Add campaign placement to keyword bid campaign
- Update the campaign placement for a keyword bid campaign
To understand details about ‘Request Header' or 'Authorization’,
please refer to the Authorization Guide
Suggested Keywords
Description: Fetch and list all campaign placements
End Point: /api/v1/placements
HTTP Method: GET
Query Parameters
| Parameter | Description | Type | Required | Possible Values | 
| campaignId | The ID of the campaign for which the ad group(s) should be returned | Integer | Y | Unique numeric identifier | 
| advertiserId | The ID of the advertiser. It returns all campaigns run by specific advertiser in response | Integer | Y | Advertiser ID for which the campaign placements are to be retrieved | 
Sample Request
|  | curl --location 
'https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements?advertiserId={advertiserId}&campaignId={campaignId}'
--header 'Authorization: Bearer *********************'
--header 'wm_consumer.id: *************'
--header 'wm_sec.key_version: 2'
--header 'wm_sec.auth_signature: *************'
--header 'wm_qos.correlation_id: 12345'
--header 'wm_consumer.intimestamp: 1701088178000'
 | 
 
|  | OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements?advertiserId={advertiserId}&campaignId={campaignId}")
.method("GET", body)
.addHeader("Authorization", "Bearer *********************")
.addHeader("wm_consumer.id", "***********************")
.addHeader("wm_sec.key_version", "2")
.addHeader("wm_sec.auth_signature", "*************")
.addHeader("wm_qos.correlation_id", "12345")
.addHeader("wm_consumer.intimestamp", "1700221256000").build();
Response response = client.newCall(request).execute();
 | 
 
|  | const axios = require('axios'); 
let config = { 
method: 'get', 
maxBodyLength: Infinity, 
url: 'https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements?advertiserId={advertiserId}&campaignId={campaignId}', 
headers: {  
    'wm_consumer.id': '****************',  
    'wm_sec.key_version': '2',  
    'wm_sec.auth_signature': '*************',  
    'wm_qos.correlation_id': '12345',  
    'wm_consumer.intimestamp': '*************',  
    'Authorization': 'Bearer ****************' 
} 
}; 
axios.request(config) 
.then((response) => { 
console.log(JSON.stringify(response.data)); 
}) 
.catch((error) => { 
console.log(error); 
}); 
 | 
 
|  | import requests 
url = "https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements?advertiserId={advertiserId}&campaignId={campaignId}" 
payload = {}
headers = {
    'Authorization': 'Bearer ******************',
    'wm_consumer.id': '***********************',
    'wm_sec.key_version': '2',
    'wm_sec.auth_signature': '*************',
    'wm_qos.correlation_id': '12345',
    'wm_consumer.intimestamp': '1700221256000',
}
response = requests.request("GET", url, headers=headers, data=payload) 
print(response.text)
 | 
 
 
 
Response
| Element | Description | Type | 
| placement | where the campaign is to have a placement | String | 
| status | Status of the campaign placement | String | 
Sample Response
[
  {
    "placement": "string",
    "status": "included"
  }
]
Add campaign placement
Description: Add campaign placement to keyword bidded campaign.
End Point: /api/v1/placements
HTTP Method: POST
Query Parameters
| Parameter | Description | Type | Required | Possible Values | 
| campaignId | The ID of the campaign for which the placement will be added to | Integer | N | Unique numeric identifier | 
| advertiserId | The ID of the advertiser. It returns all campaigns run by specific advertiser in response | Integer | N | Advertiser ID for which the campaign placements are to be retrieved | 
Body Parameters
| Parameter | Description | Type | Required | Possible Values | 
| campaignId | The ID of the campaign for which the placement will be added to | Integer | Y | Unique numeric identifier | 
| placements | Array of Objects, each of which contains placement and status of the placement. The type of both placementandstatusproperties is String. | Array of Objects | Y | Possible values for placement: Search CarouselItem BuyboxItem Carousel
 Possible values for status:
 enabledpausedarchived
 | 
Sample Request
|  | curl --location 
'https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements'
--header 'Authorization: Bearer *********************'
--header 'Content-Type: application/json'
--header 'wm_consumer.id: *************'
--header 'wm_sec.key_version: 2'
--header 'wm_sec.auth_signature: *************'
--header 'wm_qos.correlation_id: 12345'
--header 'wm_consumer.intimestamp: 1701088178000'
--data '[{
    "campaignId": 1234,
    "placements": [{
        "placement": "string",
        "status": "included"
    }]
}]'
 | 
 
|  | OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "[{
    "campaignId": 1234,
    "placements": [{
        "placement": "string",
        "status": "included"
    }]
}]");
Request request = new Request.Builder()
.url("https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements")
.method("POST", body)
.addHeader("Authorization", "Bearer *********************")
.addHeader("wm_consumer.id", "***********************")
.addHeader("wm_sec.key_version", "2")
.addHeader("wm_sec.auth_signature", "*************")
.addHeader("wm_qos.correlation_id", "12345")
.addHeader("wm_consumer.intimestamp", "1700221256000")
.addHeader("Content-Type", "application/json").build();
Response response = client.newCall(request).execute();
 | 
 
|  | const axios = require('axios'); 
let data = JSON.stringify([ 
{ 
    "campaignId": 1234, 
    "placements": [{ 
        "placement": "string", 
        "status": "included" 
    }] 
} 
]); 
let config = { 
method: 'post', 
maxBodyLength: Infinity, 
url: 'https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements', 
headers: {  
    'wm_consumer.id': '****************',  
    'wm_sec.key_version': '2',  
    'wm_sec.auth_signature': '*************',  
    'wm_qos.correlation_id': '12345',  
    'wm_consumer.intimestamp': '*************',  
    'Content-Type': 'application/json',  
    'Authorization': 'Bearer ****************' 
}, 
data : data 
}; 
axios.request(config) 
.then((response) => { 
console.log(JSON.stringify(response.data)); 
}) 
.catch((error) => { 
console.log(error); 
}); 
 | 
 
|  | import requests
import json
url = "https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements"
payload = json.dumps([{
    "campaignId": 1234,
    "placements":[{
            "placement": "string",
            "status": "included"
        }]
}])
headers = {
    'Authorization': 'Bearer ******************',
    'wm_consumer.id': '***********************',
    'wm_sec.key_version': '2',
    'wm_sec.auth_signature': '*************',
    'wm_qos.correlation_id': '12345',
    'wm_consumer.intimestamp': '1700221256000',
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
 | 
 
 
 
Response
| Element | Description | Type | 
| code | Returns if operation is a failure or success | String | 
| details | Any detailed comments in the response. If the operation was a failure, returns reason for failure. If success returns blank value | String | 
| campaignId | A numeric identifier of campaign that has had placement updated | Integer | 
Sample Response
[
    {
        "code": "success",
        "details": "string",
        "campaignId": 0
    }
]
Update campaign placement
Description: Update the campaign placement for a keyword bidded campaign.
End Point: /api/v1/placements
HTTP Method: PUT
Query Parameters
| Parameter | Description | Type | Required | Possible Values | 
| campaignId | The ID of the campaign for which the placement will be added to | Integer | N | Unique numeric identifier | 
| advertiserId | The ID of the advertiser. It returns all campaigns run by specific advertiser in response | Integer | N | Advertiser ID for which the campaign placements are to be retrieved | 
Body Parameters
| Parameter | Description | Type | Required | Possible Values | 
| campaignId | The ID of the campaign for which the placement will be added to | Integer | Y | Unique numeric identifier | 
| placements | Array of Objects, each of which contains placement and status of the placement. The type of both placementandstatusproperties is String. | Array of Object | Y | Possible values for placement: Search CarouselItem BuyboxItem Carousel
 Possible values for status:
 enabledpausedarchived
 | 
Sample Request
|  | curl --location --request PUT
'https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements'
--header 'Authorization: Bearer *********************'
--header 'wm_consumer.id: *************'
--header 'wm_sec.key_version: 2'
--header 'wm_sec.auth_signature: *************'
--header 'wm_qos.correlation_id: 12345'
--header 'wm_consumer.intimestamp: 1701088178000'
--header 'Content-Type: text/plain'
--data '[{
    "campaignId": 1234,
    "placements": [{
        "placement": "string",
        "status": "excluded"
    }]
}]'
 | 
 
|  | OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, 
"[
    {
        "campaignId": 1234,
        "placements":[{
                "placement": "string",
                "status": "excluded"
            }]
    }
]");
Request request = new Request.Builder()
  .url("https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements")
  .method("PUT", body)
  .addHeader("Authorization", "Bearer *********************")
  .addHeader("wm_consumer.id", "***********************")
  .addHeader("wm_sec.key_version", "2")
  .addHeader("wm_sec.auth_signature", "*************")
  .addHeader("wm_qos.correlation_id", "12345")
  .addHeader("wm_consumer.intimestamp", "1700221256000")
  .addHeader("Content-Type", "text/plain").build();
Response response = client.newCall(request).execute();
 | 
 
|  | const axios = require('axios'); 
let data = JSON.stringify([ 
{ 
    "campaignId": 1234, 
    "placements": [{ 
        "placement": "string", 
        "status": "excluded" 
    }] 
} 
]); 
let config = {
method: 'put', 
maxBodyLength: Infinity, 
url: 'https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements', 
headers: {  
    'wm_consumer.id': '****************',  
    'wm_sec.key_version': '2',  
    'wm_sec.auth_signature': '*************',  
    'wm_qos.correlation_id': '12345',  
    'wm_consumer.intimestamp': '*************',  
    'Content-Type': 'application/json',  
    'Authorization': 'Bearer ****************' 
}, 
data : data 
}; 
axios.request(config) 
.then((response) => { 
console.log(JSON.stringify(response.data)); 
}) 
.catch((error) => { 
console.log(error); 
}); 
 | 
 
|  | import requests
url = "https://developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/placements"
payload = "[{
    "campaignId":  1234,
    "placements":[{
            "placement": "string",
            "status": "excluded"
        }]
}]"
headers = {
    'Authorization': 'Bearer ***************',
    'wm_consumer.id': '***********************',
    'wm_sec.key_version': '2',
    'wm_sec.auth_signature': '*************',
    'wm_qos.correlation_id': '12345',
    'wm_consumer.intimestamp': '1700221256000',
    'Content-Type': 'text/plain'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
 | 
 
 
 
Response
| Element | Description | Type | 
| code | Returns if operation is a failure or success | String | 
| details | Any detailed comments in the response. If operation was a failure returns reason for failure. If success returns blank value | String | 
| campaignId | A numeric identifier of campaign that has had placement updated | Integer | 
Sample Response
[
    {
        "code": "success",
        "details": "string",
        "campaignId": 0
    }
]