Sending messages from a human agent to the visitor

Send messages from a human agent to the visitor in case of an escalation using Ultimate Chat Widget

When the visitor and the bot are talking and an escalation attempt is triggered, the webhook in your application 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 your application to establish a connection with a human agent. Using this endpoint, you can provide real time updates to the visitor about the status of the escalation process. The list of available events to be sent is the following:

  • escalationQueueUpdate: in the event of the visitor being in a queue for an available human agent, you can share a queue position and/or waiting time information.
  • escalationSuccess: in the event the visitor is connected with a human agent, you can provide 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: If there is the need to send an agent’s message to the visitor’s widget. This can only be sent after the escalationSuccess event.
  • escalationFailed: In the event the escalation process failed, and the visitor couldn’t be connected with an agent.
  • agentDisconnect: In the event the agent ended the escalated conversation.

Each of these events has a different payload that you can find in this article covering all the details about Widget Escalation Events.