DaviniaGarridoLope | 2018-02-19 14:59:49 UTC | #1
Hello, we are implementing a data action to assign a wrap up code to an interaction and disconnect it using the API
PATCH /api/v2/conversations/emails/{conversationId}/participants/{participantId}
We obtain a code error 403 - Not authorized when executing the validation test within the PureCloud UI. Could you please give us any ideas on what could be wrong? Please find below the data action configuration:
INPUT CONTRACTS:
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Update conversation participant", "description": "Update conversation participant", "type": "object", "required": [ "conversationId", "agentParticipantId" ], "properties": { "conversationId": { "type": "string", "description": "conversationId" }, "agentParticipantId": { "type": "string", "description": "agentParticipantId" }, "codeID": { "type": "string", "title": "codeID", "description": "codeID" } } }
OUTPUT CONTRACTS:
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "", "description": "", "type": "object", "properties": {} }
REQUEST:
{ "requestUrlTemplate": "/api/v2/conversations/emails/${input.conversationId}/participants/${input.agentParticipantId}", "requestType": "PATCH", "headers": {}, "requestTemplate": "{\"wrapup\": {\"code\": \"${input.codeID}\" }, \"state\":\"disconnected\"}" }
RESPONSE:
{ "translationMap": {}, "successTemplate": "${rawResult}" }
Thanks in advance.
Jason_Mathison | 2018-02-23 18:32:40 UTC | #2
The likely cause is that this API requires that you authenticate as a user who is a party to the conversation.
Can you rerun your action test and let me know what region you ran the test against? That should allow me to verify the cause of the 403.
DaviniaGarridoLope | 2018-02-26 07:44:53 UTC | #3
I have just rerun my action and this is the response (the region is EMEA):
{ "status": 403, "code": "not.authorized", "message": "You are not authorized to perform the requested action.", "messageParams": {}, "contextId": "3d082780-d2f3-41df-8763-574b01339108", "details": [], "errors": [ { "status": 403, "code": "NOT_AUTHORIZED", "message": "REST call for action execute failed. Message:Request to backend service failed. To see error details, execute request in Postman, or other REST tools. [3d082780-d2f3-41df-8763-574b01339108] [3d082780-d2f3-41df-8763-574b01339108]", "messageParams": {}, "details": [], "errors": [] } ] }
Jason_Mathison | 2018-02-26 15:36:52 UTC | #4
So it appears to me that two things happened here:
First, as far as I can tell from the logs (although I am not an expert here) the wrapup code was set by your patch request.
Second, the request to disconnect the email was rejected because the client credential is not a user associated with the conversation. We are tracking this feature request internally (CLINT-I-97), and have added your information as a customer who is trying to do this.
system | 2018-03-29 15:37:02 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 2515