Send Message via Web Messaging API

Hello everyone,

We have used a Bot Flow before the Transfer to ACD action in our Inbound Message Flow for Web Messaging.
In that Bot Flow we make webservice requests to an external custom ChatBot. This ChatBot can send asynchronous multiple responses at any time.
However webservice request mechanism in the Bot Flow works upon request/response sequence whereas our requirement is writing to the customer as a Bot message at any time when a message comes from our ChatBot even when there isn't any other request by the customer or in the flow after starting the chat messaging.

I think we need to have a websocket connection in the Bot Flow to listen continuously from the external ChatBot or a Web Messaging API to be able to call any time to send a message to the customer on behalf of the Bot for an existing conversation.

There is an API as I've seen such as,
POST /api/v2/conversations/messages/{conversationId}/communications/{communicationId}/messages
Is that API provides sending messages on behalf of the Bot at any time when a conversation is started by an authenticated or unauthenticated customer.

With that API request I need to provide conversationId and communicationId parameters.
I already know conversationId but couldn't find the communicationId as it's name in conversation details requested to
GET /api/v2/analytics/conversations/{conversationId}/details
or
GET /api/v2/conversations/{conversationId}

However, I tried all the Id's such as sessionId, Id, externalContactId etc. I've found in the conversation details but I get "CommunicationId not found" error response from the API request.

Can you please help me to find a solution.

Regards,

1 Like

Hello @ugur.bayramoglu we're seeing more of these use-cases where the 3rd party Bot response is coming back with substantial delay, completely asynchronously.
This will be solved once we add support for Agentless outbound messages within Web Messaging, please vote https://genesyscloud.ideas.aha.io/ideas/DXWMM-I-25

Hello @Angelo_Cicchitto,
Thanks for your quick respond.
Until an API feature to send agentless outbound messages is being developed, I need to find a workaround solution.

I see an API request such as replace participant of a conversation,
POST /api/v2/conversations/{conversationId}/participants/{participantId}/replace

So, can I create a virtual agent user to replace the Bot user or directly transfer to that user in the flow and send messages with an API via that user?
If it's not possible we can create a regular agent user which pretends like a Bot and transfer all the conversations to that user at the beginning.
But eventually I will need a suitable API request to send outbound message on behalf of that agent user anyway, I couldn't find any such, do you know any API for that purpose?

For example what is this API used for,
POST /api/v2/conversations/messages/{conversationId}/communications/{communicationId}/messages

Regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.