Conversational AI
  • Introduction
  • Getting started
    • Getting started
    • Adding content to your bot
    • Capture information with entities
    • Capture information with input validation
    • Reusing intents with context
    • Flow navigation with variables
    • Adding new users to your account
  • Understanding users
    • Natural Language Processing (NLP)
      • NLP threshold
      • NLP Import & Export
      • Train your bot with actual user messages
      • NLP Dashboard & NLP Improve
      • Synonym entities
      • System entities
      • Supported languages
      • Intent templates
    • Expression generator
    • Context
    • Multi-language bots
  • Bot answers
    • Bot dialogs
      • Message components
      • Go To
      • Input Validation
      • Action
      • Translations
    • Conversations
    • Analytics
      • User flow
    • Publishing your bot
    • Events
    • Reuse flows
    • Settings
      • Variables
  • Integrations
    • API integration
      • Advanced API integrations
    • Chat message structure for API's
    • Retrieving data from Airtable (GET)
    • Sending data to Airtable (POST)
    • Human handover & live chat
      • #Interact
      • RingCentral Engage Digital
      • Genesys Cloud
      • Help Scout
      • Zendesk Chat
      • Intercom
      • Sparkcentral (beta)
      • Offloading Webhook
  • Channels
    • Channels
    • Facebook Messenger
      • Facebook Admin Removal
      • Facebook Webview Whitelisting
    • WhatsApp Business API
    • Google Assistant
    • Webhook Channel API
    • Chat widget
    • Phone & voice
    • Workplace from Facebook
    • Sinch Conversation API (beta)
  • Tips & Best practices
    • How to NLP
    • Creating diverse expressions
    • Why is my bot not responding the way I want it to?
    • What makes a good chatbot?
    • How to recognize a returning bot user
    • Gathering user feedback
    • Using time in your chatbot
Powered by GitBook
On this page
  • Configuration
  • API Methods
  • API Health Check
  • Messages
  • Offload
  • Recipes
  • User-requested human handover
  • Sending messages as an agent

Was this helpful?

  1. Integrations
  2. Human handover & live chat

Offloading Webhook

Learn how to create your own human handover integration through the Offloading Webhook

PreviousSparkcentral (beta)NextChannels

Last updated 4 years ago

Was this helpful?

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

This feature is currently in beta. If you would like access, please get in touch.

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.

API Methods

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 a type parameter that allows you to distinguish between the different types of data coming in. Different types are explained below.

We expect a 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>

Request Body

Name
Type
Description

timestamp

string

The time at which the message was generated

messages

array

An array of user and bot messages

type

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 -

{
    "type": "bot" | "user",
    "message": UserMessage | BotMessage
}
// BotMessage example
{
    "type": "bot",
    "message": { "text": "Hi, I'm a chatbot" }
}

UserMessage objects may have the following structures:

// UserMessage examples

// Intro
{ "messageType": "intro" }

// Text
{ "messageType": "text", "text": "Hi, I'm a user and I'd like to talk to an agent" }

// Upload
{ "messageType": "upload", "urls": [] }

// Location
{ "messageType": "location", "coordinates": { "lat": 0, "long": 0 } }

// Postback
{ "messageType": "postback", "title": "I'm a button" }

Offload

POST <your_api_url>

Request Body

Name
Type
Description

payload

object

The payload you configured in the action dialogstate

channel

string

transcript

array

An array containing all messages sent throughout the conversation.

type

string

The type of request, in this case offload

timestamp

string

sessionId

string

version

string

botId

string

{
    "offloadSuccess": true,
    "pauseBot": true
}

Recipes

User-requested human handover

Use a "Send to offload provider" bot action dialog to trigger an offload call to your API.

Sending messages as an agent

BotMessage objects follow the same structure as that of the Webhook Channel API, documented .

Use the to send messages as an agent.

here
asynchronous actions API