The offloading webhook allows you to integrate any human handover live chat platform. You can use the webhook to:
Receive incoming user messages
Receive outgoing bot messages
Act upon offloading requests from a user
Offloading Webhook is for offloading users from bot to human agent. The is a custom integration channel, make sure you don't mix up these two!
Configuration
To configure your Chatlayer Offloading Webhook, head over to Settings > Offloading and create a Webhook integration.
Enter the API URL for your webservice and a Verify Token allowing you to validate incoming requests.
We will send a test request to your API URL when you press Save to validate whether your webservice is alive and ready to take requests, described in the Health Check method.
Congratulations! You are ready to start using your custom human handover integration.
Webservice Implementation Reference
Your webservice will need to implement the following API methods for us to communicate with. All requests will arrive in JSON format at the API URL configured during the setup of the offloading webhook in Chatlayer. Every JSON POST request has a body with an event parameter that allows you to distinguish between the different types of data coming in. Different types are explained below.
We expect a HTTP status code of 200 for every request made to the webservice. Response data should be in JSON format.
API Health Check
GET<your_api_url>
You must send the response as described in the Response tab.
Query Parameters
Name
Type
Description
challenge.verifyToken
string
The verifyToken allows you to validate the request is made by Chatlayer
{ "status": "ok" }
Messages
POST<your_api_url>
Query Parameters
Name
Type
Description
challenge.verifyToken
string
The verifyToken allows you to validate the request is made by Chatlayer
Request Body
Name
Type
Description
timestamp
string
The time at which the message was generated
messages
array
An array of user and bot messages
event
string
The type of request, in this case messages
channel
string
The channel type
sessionId
string
The user's session ID
version
string
The bot version, either DRAFT or LIVE
botId
string
The bot ID
The items in the messages array have the following format -
Use a "Send to offload provider" Action block to trigger an offload call to your API.
Sending messages as an agent
Webhook Offloading FAQs
Here you can find frequently asked questions regarding Webhook offloading
Why do I get requests on the offloading endpoint even though the user is not yet offloaded?
We send the details of all the conversations that are happening in between user and the bot to the offloading endpoint under the event: "messages" so you can takeover the conversation if need be. This would also allow customers to keep track of all the conversations if need be.
BotMessage objects follow the same structure as that of the Webhook Channel API, documented .