Accept or Reject Recommendations

Users can Apply (accept) or Reject (dismiss) recommendations using this endpoint

📘

POST /api/v1/recommendations/action

Request Parameters

ParameterNotesTypeRequired Possible Values
advertiserIdAdvertiser IdintegerYvalid advertiser ID
actions

List of actions to perform on recommendations.
Max size: 10
_**The actions objects are detailed

here

.**_

ArrayY

actions Objects

ParameterNotesType Required  Possible Values
recommendationIdID of the recommendation to act uponstringYvalid advertiser ID
actionAction to perform on the recommendationstringYACCEPT, REJECT
👉

Rules/Constraints/Validations:

  • Only ACTIVE recommendation IDs are allowed in the actions list.
  • The same recommendationId must not appear with both ACCEPT and REJECT in the same request.
  • Duplicate recommendationId values are not allowed within the request.
  • Recommendations may overlap (for example, a campaign-level change may supersede an ad group-level change). When you act on one recommendation, any overlapping recommendations may be automatically marked invalid and removed from the active set

Sample Request : Act on active recommendations

curl --location --request POST 'https://developer.api.us.walmart.com/api-proxy/service/display/api/v1/api/v1/recommendations/action' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth_token>' \
--header 'WM_SEC.AUTH_SIGNATURE: ***********' \
--header 'WM_CONSUMER.ID: abcde-v123-fa2r-a1fs-asd45f6qef' \
--header 'WM_SEC.KEY_VERSION: 1' \
--header 'WM_CONSUMER.intimestamp: 1565309779' \
--data '{ "advertiserId": 12345, "actions": [ { "recommendationId": "6f0a9153-8049-4dca-97b7-35be7dec9710-targeting", "action": "ACCEPT" }, { "recommendationId": "f37c9a1e-eec1-4727-b7b0-37aebb2e3780-targeting", "action": "REJECT" } ]
}'

Sample Request : Act on invalid recommendationIds OR Act on recommendations that were already applied or rejected before

curl --location --request POST 'https://developer.api.us.walmart.com/api-proxy/service/display/api/v1/api/v1/recommendations/action' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth_token>' \
--header 'WM_SEC.AUTH_SIGNATURE: ***********' \
--header 'WM_CONSUMER.ID: abcde-v123-fa2r-a1fs-asd45f6qef' \
--header 'WM_SEC.KEY_VERSION: 1' \
--header 'WM_CONSUMER.intimestamp: 1565309779' \
--data '{ "advertiserId": 12345, "actions": [ { "recommendationId": "6f0a9153-8049-4dca-97b7-35be7dec9710-targeting", "action": "ACCEPT" }, { "recommendationId": "f37c9a1e-eec1-4727-b7b0-37aebb2e3780-targeting", "action": "REJECT" } ]
}'

Response

ElementDescriptionNullable?TypePossible values
resultsList of results corresponding to each action.YArray
codeThe response code can have following values:
• success
• failure
Ystringsuccess, failure
detailsDetails will populate success or error message depending upon value of code.Yarray<string>Refer to this link for detailed error messages
messageHigh-level summary of the error, when available. Ystring 
errorsDetailed information about one or more errors, including the affected field (when applicable), error code, and a human-readable description.Yarray<object> 

errors array object details

FieldDescriptionOptional field/Nullable?TypePossible values
fieldJSON field associated with the error (for example, startDate ). Omitted if the error applies to the request as a whole.Ystring 
errorTypeMachine-readable error code that uniquely identifies the error condition. Applications should use this value for error handling logic.Nstring 
descriptionHuman-readable explanation of the error, including why the request failed and, when possible, how to resolve itNstring 

results object

ElementDescriptionNullable?TypePossible values
codeStatus of processing this specific actionstringsuccess, failure
detailsList of detail messages and/or error codes for this actionArray
recommendationIdID of the recommendation for which the action was processed.Ystring
actionAction that was requested for this recommendationYstringACCEPTED, REJECTED

Sample Response : Act on active recommendations

{ "results": [ { "recommendationId": "6f0a9153-8049-4dca-97b7-35be7dec9710-targeting", "action": "ACCEPT", "code": "success" }, { "recommendationId": "f37c9a1e-eec1-4727-b7b0-37aebb2e3780-targeting", "action": "REJECT", "code": "success" } ]
} 

Sample Response : recommendationId does not exist, recommendation already applied or rejected

{ "results": [ { "recommendationId": "6f0a9153-8049-4dca-97b7-35be7dec9710-targeting", "action": "ACCEPT", "code": "failure", "details": ["RECOMMENDATION_DOES_NOT_EXIST"] }, { "recommendationId": "f37c9a1e-eec1-4727-b7b0-37aebb2e3780-targeting", "action": "REJECT", "code": "failure", "details": ["RECOMMENDATION_IS_ALREADY_ACCEPTED_OR_REJECTED"] } ]
}

Sample Response - Failure

{ "code": "failure", "details": [ "string" ],   "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ]
}

Did this page help you?