Dear PureCloud Developers
Hope this message finds you well.
Please may I ask for your assistance with the PUT data action to update a data table row?
I am wishing to use the PUT API https://api.{{environment}}/api/v2/flows/datatables/{{datatableId}}/rows/{{rowId}} and update the row of a table from the architect.
This is my second data action, I invite all of your feedback please to help me be better.
The following data action has been implemented, and returns thefollowing error (note: this user has full access to PC).
{
"status": 403,
"code": "not.authorized",
"message": "You are not authorized to perform the requested action.",
"messageParams": {},
"contextId": "a7f04fd9-63b0-45db-abe7-2579b033af67",
"details": [],
"errors": [
{
"status": 403,
"code": "NOT_AUTHORIZED",
"message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"status\":403,\"code\":\"missing.any.permissions\",\"message\":\"Unable to perform the requested action. You must have at least one of the following permissions assigned: [architect:datatable:edit]\"} [a7f04fd9-63b0-45db-abe7-2579b033af67] [a7f04fd9-63b0-45db-abe7-2579b033af67]",
"messageParams": {},
"details": [],
"errors": []
}
]
}
Please kindly find below the Data Action input/output.
Input
{
"$schema": "..",
"title": "Update Table",
"description": "using this to update the table",
"type": "object",
"required": [
"datatableId",
"rowId",
"Score"
],
"properties": {
"datatableId": {
"description": "dataTableId",
"type": "string"
},
"Score": {
"description": "Score",
"type": "integer"
},
"rowId": {
"description": "Which key to update",
"type": "integer"
}
}
}
Output
{
"$schema": "..",
"title": "Update the data table",
"description": "Table updated",
"properties": {}
}
Request
{
"requestUrlTemplate": "/api/v2/flows/datatables/{input.datatableId}/rows/{input.rowId}",
"requestType": "PUT",
"headers": {
"Transfer-Encoding": "buffered",
"UserAgent": "PureCloudIntegrations/1.0",
"Content-Type": "application/json"
},
"requestTemplate": "{"Score": "${input.Score}"}"
}
Response
{
"translationMap": {},
"successTemplate": "${rawResult}"
}