I am developing an integration application and trying to send a chat message from my app to the active webChat with the guest. I am logged in as an agent, use the developer tools to initiate a chat from a different browser, follow the loginImplicitGrant login (since it's a web app), get the token etc. (although in your documentation you state that this call postWebchatGuestConversationMemberMessages requires no permission). Still, I get 403 when I try to send the message. Am I doing something wrong?
Also please update the documentation to better describe the "body" param of that method. What is the "bodyType"? You have to dig the api to find out.
Based on what you're saying it sounds like you're trying to use the guest chat APIs to post a message as an agent and are trying to authenticate as an agent. That won't work.
Thanks for double-checking. Now I need the communicationId. As you describe in this post
the communicationId is per active communication, the id of that. So in my case, the communicationId should be the chatId. It seems that the ChatId and ConversationId are the same. When I try to use your method postConversationsChatCommunicationMessages, I get a 404. Shouldn't it work as expected? Thanks in advance
No, the conversationId and the communicationId are different.
If you get active conversations for the logged in user (GET /api/v2/conversations), you will get a list/array of entities (entity = a conversation).
The id at the root of the entity corresponds to the conversationId.
Within that entity (conversation), you have a participants attribute (array of participants).
You need to find the one which corresponds to your Contact Center Agent.
For this participant element, you will have a "chats" attribute (array of chats).
Within that chat element, there is an id which corresponds to the communicationId.
In my case, I found the agent participant element corresponding to my agent. In that element (participant) I have something like this:
"chats": [
{
"state": "connected",
"id": "e90cf022-9564-4c5a-a6a8-2fbc0875f645",
"segments": [],
"held": false,
"startAlertingTime": "2019-11-06T13:38:57.876Z",
"connectedTime": "2019-11-06T13:38:59.594Z",
"provider": "PureCloud Webchat v2",
"scriptId": "c0bfc5ca-f9c8-4374-b720-f392053ffe35",
"avatarImageUrl": "https://prod-euw1-inin-directory-service-profile.s3-eu-west-1.amazonaws.com/751e1895/3ee7/4da9/9596/2a24729fffdb.jpg"
}
]
"id": "e90cf022-9564-4c5a-a6a8-2fbc0875f645" is my communicationId.
Note you can also get the same info if you know the conversationId and get conversation by id (GET /api/v2/conversations/{conversationId})
OK I followed your instructions but still get a 404. Let me provide some info
GET https://api.mypurecloud.de/api/v2/conversations
response -> I get the entity[0].id as the conversationId (fa1ed98e-ec21-4c75-8c30-02b8629b4b1b)
I find inside that entity the participant with purpose: "agent" and get his chats[0].id (5fb0c3e3-63b1-4733-a116-76eebb3be679)
POST https://api.mypurecloud.de/api/v2/conversations/chats/fa1ed98e-ec21-4c75-8c30-02b8629b4b1b/communications/5fb0c3e3-63b1-4733-a116-76eebb3be679/messages
I also tried the participant with purpose:"acd" but with no luck.
What I did is Admin-> Integrations-> + Integrations -> Custom Client Application and then started configuring it. I can't seem to find that version configuration you are referring to. Is it a property in the advanced section of the integration/configuration that I should add manually? Can you please refer an article about it? Thanks in advance