How to send messages from an agent to the visitor
Send messages from an agent to the visitor in case of escalation using Ultimate Chat Widget
When the visitor and the bot are talking,
and an escalation attempt is triggered,
the webhook in the custom CRM will receive a widgetEscalate
event as described in this article.
While using the Ultimate Chat Widget, Agent escalations are supported through the endpoint /agent/converse/send-message-to-widget. This endpoint can be used to send escalation updates or messages from the Agent to the Visitor.
From this moment on, it is up to the custom CRM to establish a connection with an agent. Using this endpoint, it can provide real time updates to the visitor about the status of the escalation process. The list of available events to be sent:
- escalationQueueUpdate: the visitor is in a queue for a free agent. It can contain queue position and/or waiting time information.
- escalationSuccess: the visitor is now connected with the agent, providing the agent’s name and avatar. From this moment on, the visitor will be able to send messages to the agent and vice-versa.
- message: send an agent’s message to the visitor’s widget. It can only be sent after escalationSuccess event.
- escalationFailed: the escalation process failed, and the visitor couldn’t be connected with an agent.
- agentDisconnect: the agent ended the escalated conversation.
Each of these events has a different payload, please see this article for all the details about Widget Escalation Events.