MinnaW | 2019-08-14 14:28:12 UTC | #1
Hello,
My use case is to add external chat information (specific to an Agent) to Purecloud reporting, so that chat sessions of 3rd party platform would be shown in Purecloud's Performance views (Offers incremented, Answer num incremented, and Handle time incremented). This shouldn't require user interaction of the Agent, so it is performed server-side.
Method has been to simulate "answering chat and marking it done when external session ends":
- establishing a new 3rd party chat (POST /conversations/chats)
- transferring ACD-participant to the Agent-participant (POST /conversations/chats/{conversationId}/participants/{participantId}/replace)
- marking state connected (PATCH /conversations/chats/{conversationId}/participants/{participantId} with data {"state": "connected"})
This is where the following error occurs: "status":400,"code":"conversation.participant.update.invalid","message":"Failed to update properties on conversation participant.","details":[],"errors":[{"status":403,"code":"not.authorized","message":"Access to Conversation 1a4d5534-4d6f-4b8a-a1e8-22355417110a is forbidden.","details":[{"fieldName":"state"}]}]}
I have been given client credentials to work with, but based on forum post PATCH /api/v2/conversations/{conversationId}/participants/{participantId} works well in dev tools but not in actions I think this API requires auth code grant (for server-side requests)? Or is this the way to go for such (reporting related) use case in the first place? An optimal situation would be, where the 3rd party chat is automatically transferred, shown ongoing, and automatically wrapped up in synchronity with the 3rd party chat.
Thanks, Minna
tim.smith | 2019-08-15 21:07:42 UTC | #2
MinnaW, post:1, topic:5789
so that chat sessions of 3rd party platform would be shown in Purecloud's Performance views
You can't alter the out of the box reports/views. If you want standard PureCloud data and custom data in one page, you'll need to build the whole page. If you build this into a web page, you can add it as a Custom Client Application.
You should be able to set participant attributes using client credentials, but you can't do anything else to the participant like answer, hold, mute, disconnect, etc. What exactly is the error you're getting?
MinnaW | 2019-08-16 07:08:31 UTC | #3
The error was namely
MinnaW, post:1, topic:5789
"errors":[{"status":403,"code":"not.authorized","message":"Access to Conversation 1a4d5534-4d6f-4b8a-a1e8-22355417110a is forbidden.","details":[{"fieldName":"state"}]
but I got it working now using a new access token from Authorization Code Grant.
So is this correct, if we wish for simultaneous third party chats to go in out-of-the-box reports/views, then we must perform simulation of all activities in Purecloud side (transferring, cancelling alerting, connecting, disconnecting, wrapup)?
This is, without need of user interaction during said third party chat. It's OK if user themself wishes to modify (or even early close) the Purecloud side of it, but we want it otherwise go automatically in Purecloud performance reports.
tim.smith | 2019-08-16 15:15:52 UTC | #4
As stated above, you can set participant attributes using client credentials. Everything else needs to be done by a human, i.e. using auth code or implicit grant to authorize the app for each user.
MinnaW | 2019-08-17 17:51:40 UTC | #5
What about using an auth code, authorized by one user, to perform actions on other users?
We intent to control users' state programmatically, so authorizing each user separately, and renewing said authorization (due to lack of auth code Refresh Token), seems cumbersome.
tim.smith | 2019-08-19 13:47:23 UTC | #6
Users can't control other users' conversations. Every user has to be authorized individually.
system | 2019-09-19 13:47:29 UTC | #7
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: 5789