Hi, I'm currently facing an issue when I try to insert a message into a chat conversation with an external contact.
I start a new conversation by doing:
platformClient.ConversationsApi().postConversationsChats({
"queueId": QUEUE_ID,
"provider": "Webchat",
"skillIds": [ "SOME_SKILL_ID" ],
"priority": 0,
"attributes": {
"phone" : "+55 34 00000-0000"
},
"customerName": "Bryan Jackson"
});
It returns me a 200 with the following payload:
"data": {
"id": "99999999-9999-9999-9999-99999999999",
"otherMediaUris": [],
"selfUri": "/api/v2/conversations/chats/99999999-9999-9999-9999-99999999999"
}
Everything alright, no ?! No ... because when I try to insert a message with the following:
platformClient.ConversationsApi().postConversationsChatCommunicationMessages(
conversationId,
communicationId , { body : message });
I face a 404 error, and in the error code it says: "chat.errors.not.found". In communicationId I put the chatId that belongs to the participant who has "customer" purpose... and in conversationId I put the id of the conversation I just created.
I'm really stuck and don't know how to proceed, could any one help me please?
OBS: let me know if it's even possible to start a chat conversation with an external contact.
The postConversationsChats is to create a 3rd party chat.
Consider this as a "work-item" of type chat - meaning that the media channel (exchange of messages between users) does not go through Genesys Cloud and is not managed by Genesys Cloud (but by a 3rd party chat system). See here for some information on 3rd party chat
That's why your attempt to send a message in the chat conversation is failing.
You will be able to send a message in the chat conversation only if it is a real/native Genesys Cloud chat.
If you want to create a chat session with Genesys Cloud (Chat v2), you have to use the Guest Chat API [API used on "public" side - customers to Genesys Cloud].
Or you can use the built-in Widgets v2 UI.
As a note, you will only be able to send a message in a Chat v2 conversation if you are an active participant of that conversation (user credentials to obtain the authorization token + user is connected to this chat conversation as a participant/member).
Now, it makes sense to me .. I will take a loot in Guest chat conversations.
Thanks a lot!!
Final doubt! .. Once I created a guest chat conversation, is it possible to transfer in behalf of queue so a real Genesys Cloud user can see that conversation and contact the user?
I am not totally sure I understand what you mean by "contact the user".
You can create a Guest Chat conversation (Chat v2), and depending on your Widget Deployment configuration, it can be put in an ACD Queue directly, or trigger an Architect Inbound Chat flow (which can then transfer the chat to an ACD Queue).
An "On Queue" Contact Center Agent (and member of the ACD Queue) can then receive the chat and exchange messages in that chat conversation.
Note that Chat v2/Guest Chat conversation is synchronous chat.
As explained in the Guest Chat API page, after requesting a new chat, you need to create a websocket and maintain that websocket during the conversation (otherwise the chat conversation will not be created and submitted in Genesys Cloud).
If the websocket is closed, the Chat Conversation will be automatically terminated after a couple of minutes at server level.
If your goal is different, then please provide more explanations on your use case.
My goal was a little bit different. I have a chatbot in dialogflow which has an integrantion with Twillio's Whatsapp, then I was building a API so I could receive the messages, create an "temporary" chat in Genesys and then transfer to an active user in Genesys Cloud so he can contact the external user on his maner.
But now I totally understand that's not possible with chat conversation.
Your explanation helped a lot. I'll try another approach.
As a note, we support integration with WhatsApp as message channel, and we support integration with Google DialogFlow for voice/chat bots (from Genesys Cloud).
Regarding your use case, you could still use a 3rd Party Chat (as you did at the beginning), and pass the info you want in the attributes object (phoneNumber, email, whateverYouWant). You could then expose these attributes via a Script so the agent can view them (it will not provide a way for the agent to contact the customer via a click - but he will see the info which were sent as attributes in the postConversationsChats request).
If the idea is that the agent will call back the customer on the provided phone number (voice call), then you could submit a scheduled callback request (immediate or planned at later time).
The Genesys Cloud Desktop is built to expose a "call" button so the agent can just click and initiate the call to the customer.
You can also send additional attributes/information in the callback request (inside the data object).
And you can then expose these attributes via a Script so the agent can view them.