applyRecommendations
This method applies recommendations by ID and returns success and failure details for each one requested.
Note
Do not use this API route for allow access requests type recommendations. This functionality will be supported with the upcoming releases.
Parameters
Name | Description | Included in request | Type | Values |
|---|---|---|---|---|
| The ID of the company the recommendations you want to apply belong to. | Optional NoteMandatory when applying recommendations from another company. | String | Must be a valid company ID for which you have management rights to. Default value: The ID of the company associated with the API key used for the request. |
| The IDs of the recommendations you want to apply. | Mandatory | Array of strings | Must be valid recommendation IDs and must belong to the same company. |
These are common parameters, available across all public API methods.
Parameter | Description | Included in request | Type | Values |
|---|---|---|---|---|
| This parameter adds an identifier to the request, linking it to its corresponding response. The target replies with the same value in the response, allowing easy call tracking. | Mandatory | String | No additional requirements |
| The name of the method you are using to send the request. | Mandatory | String | Must be a valid method name. |
| The version of JSON-RPC used by the request and the response. | Mandatory | Integer | Possible values:
|
| An object containing the configuration of the request. | Mandatory | Object | No additional requirements. |
Under the | ||||
| The results page number. | Optional | Integer | Default value: |
| The number of results displayed per page. | Optional | Integer | The upper limit is 100 items per page. Default value: |
Return value
Attribute | Type | Description |
|---|---|---|
| Array of strings | The ID of the recommendations that were successfully applies. |
| Array of objects | Each object contains information on a recommendation that failed to apply. |
Objects
failedRecommendations
Attribute | Type | Description |
|---|---|---|
| String | The Id of the recommendation. |
| String | A description of the error that occurred when trying to apply the recommendation. |
| Integer | The code of the error. |
Example
Request:
{
"params": {
"recommendationIds": [
"68480f4e11e8dc005bb0f9e7",
"6853e32b4783f7a2f15582c4",
"6853e32b4783f7a2f15582cf"
],
"companyId": "67fe8595d4db0d536908ec92"
},
"jsonrpc": "2.0",
"method": "applyRecommendations",
"id": "b7e2c1d4-9f8a-4c2e-8b1a-ef1234567890"
}Response:
{
"id": "b7e2c1d4-9f8a-4c2e-8b1a-ef1234567890",
"jsonrpc": "2.0",
"result": {
"appliedRecommendations": [],
"failedRecommendations": [
{
"recommendationId": "68480f4e11e8dc005bb0f9e7",
"error": "Recommendation already applied.",
"errorCode": 3432
},
{
"recommendationId": "6853e32b4783f7a2f15582c4",
"error": "Recommendation already applied.",
"errorCode": 3432
},
{
"recommendationId": "6853e32b4783f7a2f15582cf",
"error": "Recommendation not found.",
"errorCode": 3432
}
]
}
}