Both functions return successful responses (at least no errors) but the call is not being initiated. I tried to do this from PureCloud itself and monitored the Network tab of the developer toolbar and it seems pressing “Answer” and “Begin callback” give me the same URLs, so that’s how I figured out which JavaScript SDK functions I should use in our CTI.
PureCloud seems to execute this perfectly but there is one thing I cannot figure out: When I monitor the execution of the patchConversationsallBackParticipant that PureCloud itself executes there is a participant ID at the end of the URL that I do not recognize.
What I did to come to this conclusion is that I searched through the conversation notifications that I receive in our CTI, but the participant ID PureCloud uses does not seem to be in my participants array of any of the conversations I receive. By the way I used the same scheduled callback for this and replayed it by choosing the “Make myself eligible” option in PureCloud after it failed in our CTI.
So the question is, how do I determine which participant ID to use for the patchConversationsCallbackParticipant function?
Currently I mostly receive the message below when testing my own implementation. Probably because of the incorrect participant ID.
“app.73c6d9a28e798513758f.js:3385 PureCloud error session cloud.command.answer is inactive for command cloud.command.answer”
patchConversationsCallbackParticipant returns a 202 response indicating that your request was accepted, but processing has not yet begun. It is entirely possible and expected to get the successful 202 response when your request was not actually valid and will fail.
postConversationsCall should return a conversation object with an ID, but IIRC, that response is sent as soon as a conversation ID has been allocated; the call hasn't been attempted yet. Also in this case, you can receive a successful 200 response and dialing the call may fail.
You need to find the participant that is the user; there will be a user property on the participant with the user's ID. Compare that ID with the user's ID to check for a match (after your app authorizes, get it from getUsersMe and cache it).
I checked the participants I receive inside the Conversation notifications and I can indeed check if the participant is me (by user id). However, I come to the same conclusion. Our CTI app logs all the converstations to the console including the participants. When the callback is offered we log these Conversation notifications.
I made a copy of the console log at that point. And let the callback "go by" which makes PureCloud pull me from the queue and it will schedule the callback for later.
Then I opened up my PureCloud client and clicked the "make me eligable" button. This made Purecloud offer me the same callback. Now I answer the callback in PureCloud and see that the participant ID used for the patchConversationsCallbackPArticipant request is not even in the copy of the console I made earlier when PureCloud offered the callback in my CTI...
I really do not understand why I do not have the participant ID. Could you please advise?
If you're routing the callback back to queue and letting it be ACD assigned to you again, there are probably two unique participants with your user ID. Check for the one that hasn't ended yet.