Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Save Recommendation Decisions

Save visit and task recommendation decisions.

This object is available in API version 51.0 and later for users with a Consumer Goods Cloud license.

Supported REST HTTP Methods

URI
/services/data/vXX.X/actions/standard/saveRecommendationDecision
Formats
JSON, XML
HTTP Methods
GET, HEAD, POST
Authentication
Authorization: Bearer token

Inputs

Input Details
actionParams
Type
string
Description
Required parameters based on the action type that are relevant to process a decision.
actionType
Type
string
Description
Required. Decision made for a recommendation.
The possible values are:
  • Accept
  • Reject
recommendationId
Type
string
Description
Unique identifier of the recommendation.

Outputs

Input Details
actionMessage
Type
string
Description
Details about why a recommendation is accepted or rejected.
actionStatus
Type
string
Description
Indicates whether a recommendation decision succeeded or failed.

Example

Sample Request

JSON Request Body
1{
2   "inputs": [{
3      "recommendationId":"9TuB0000000TN6iKAG",
4      "actionType":"Accept",
5      "actionParams":{
6         "TaskGenerationType":"AIVisitTaskTemplate" //For Consumer Goods Cloud
7      }
8   }]
9}

Sample Response

JSON Response Body
1{
2   "actionName": "saveRecommendationDecision",
3   "errors": null,
4   "isSuccess": true,
5   "outputValues": {
6      "actionStatus": "success",
7      "actionMessage": "The visit was scheduled.",
8   }
9}

Sample Error

JSON Error Body
1[{
2   "actionName": "saveRecommendationDecision",
3   "errors": null,
4   "isSuccess": true,
5   "outputValues": {
6      "actionStatus": "error",
7      "actionMessage": "We can’t schedule the recommendation because the recommendation status isn’t Recommended.",
8   }
9}]