Alerts & Recommendations
Overview
The Alerts and Recommendations API endpoint provides capability to list all the alerts and recommendations for the advertiser.
Usage: To list all the alerts and recommendations for the advertiser
To understand details about ‘Request Header' or 'Authorization’,
please refer to the Authorization Guide
Retrieve today’s near-real time metrics and campaign cap-out insights
Description: You can retrieve following alerts and recommendations at advertiser/campaign level on the day of request: "Ad Spend", "Remaining Budget", "Course of action"
End Point: /api/v1/alerts
HTTP Method: GET
Query Parameters
Parameter
Description
Type
Required
Possible Values
advertiserId
ID of the advertiser
Integer
Y
Unique numeric identifier
Sample Request
Curl Java Node JS Python
curl -- location \
' https : //developer.api.us.stg.walmart.com/api-proxy/service/sp/api-sams/v1/api/v1/alerts?advertiserId={advertiserId}'
-- 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 : 1707205605000 '
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/alerts?advertiserId={advertiserId}" )
. 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" , "1707205605000" )
. 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/alerts?advertiserId={advertiserId}' ,
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/alerts?advertiserId= {advertiserId} "
payload = {}
headers = {
'Authorization' : 'Bearer ***********' ,
'wm_consumer.id' : '***********' ,
'wm_sec.key_version' : '2' ,
'wm_sec.auth_signature' : '**********' ,
'wm_qos.correlation_id' : '12345' ,
'wm_consumer.intimestamp' : '1707205605000'
}
response = requests . request ( "GET" , url , headers = headers , data = payload )
print ( response . text )
Response
Element
Description
Type
campaignId
ID of the campaign
Integer
adGroupId
ID of the ad group that is part of the campaign
Integer
alertMessage
Thread of alerts and recommendations
String
createdOn
The date the alerts and recommendations were created on
Integer
alertType
Type of alert
String
Sample Response
[
{
"campaignId": 0,
"adGroupId": 0,
"alertMessage": "Ad group is running our of total budget. 28.51% total budget remaining. Keep serving ads by increasing the budget of your adGroup",
"createdOn": "2019-09-18T20:56:11.000z",
"alertType": "Budget",
}
]
HTTP Status Code
Status Code
Description
Possible Error Messages
400
Bad request
advertiserId not found in request
403
Forbidden
User not Authenticated
429
Too Many Requests
<Exception Message>
500
Internal server error
There was an error processing the request