Chatlayer Documentation
Get in touchAbout Chatlayer
  • Welcome
  • What's new
  • Send feedback
  • start quickly
    • Leadzy tutorial
      • 0. Introduction
      • 1. New bot, new block
      • 2. Understand your users
      • 3. Collect and display user input
      • 4. Steer the conversation with Conditions
      • 5. Empower your bot with Actions
      • 6. Set up a channel and publish your bot
    • Templates
      • Banking
      • E-Commerce Returns
      • E-Bike Shop
      • E-Scooter Support
      • Feedback
      • Find Nearest Location
      • GPT
      • 🆕Gym
      • Job applications
      • Knowledge base AI template
      • Lead generation
      • 🆕NPS
      • Restaurant
      • Retail
  • navigation
    • Analytics
      • Dashboard
      • Customers
      • Conversations
      • User flow
      • Intents
      • 🆕Funnels [Beta]
    • Bot builder
      • Flows
        • Canvas functionalities
        • Collaborate with team members
        • Manage your flows
        • 🆕[Beta] Export and import flows
      • Bot dialogs view
      • Translations
      • Events
    • NLP
      • Dashboard
      • Intents
      • Expressions
      • Entities
      • Train
      • NLP settings
      • Improve
    • Knowledge base AI
      • Add content to your KBAI
      • Build your KBAI flow
      • Use your KBAI source URL in a button
      • Use tags to limit your KBAI content
      • 🆕Use Tables to store your KBAI questions
      • 🆕Manage handover where KBAI is unsatisfactory
    • History
      • Conversations
      • Execution logs
      • Versions
    • Channels
    • Tables
      • Create a table with records
      • Column types
      • Operate on your records
        • Insert record
        • Update record
        • Retrieve record
        • Delete record
      • API
    • Settings
      • Bot settings
      • Offloading
      • Variables
      • Voice
      • Import/Export
  • build your bot
    • Conversation design
      • Plan your bot
      • Conversation design workflow
    • Flow logic
      • Blocks
        • Message
        • Condition
        • Collect input
        • Action
      • Go-to connections
    • 🆕Emulator
    • Tips & best practices
      • Route your flow depending on the time
      • Improve the Not understood block
        • How to create better not understood messages
        • Not understood counter
        • Not understood Google search
      • Go to previous block
      • Recognizing a returning user
      • Skip introduction message
      • Route your flow depending on the channel
      • Reuse flows
      • Connect two bots to each other
  • understand users
    • Natural language processing (NLP)
      • Basic NLP concepts
      • Detect information with entities
        • Match entities
        • Contextual entities
        • System entities
        • Composite entities
      • NLP best practices
        • Word order and diversity of expressions
      • AI intent booster
      • Train your NLP
      • Context
      • NLP import & export
      • Sentiment analysis
    • Languages
      • Supported languages
      • Make your bot multilingual
      • Change language within the conversation
  • set up channels
    • Add a channel to your bot
    • All channels
      • 🚨Facebook Messenger [Deprecated soon]
        • Facebook Admin Removal
        • Facebook Webview Whitelisting
        • Facebook Messenger API updates for Europe
      • 🚨Google Assistant [Deprecated soon]
      • Webhook
      • Web
        • 🚨Web V1 [Deprecated]
          • Customize web widget
          • Live example web widget
        • 🆕Web V2
          • 🆕From Web V1 to V2
          • 🆕Web V2 methods and options
    • Sinch Conversation API
      • Configure your Sinch Conversation API
      • 🆕 Make the most of RCS with Carousels
      • WhatsApp Business API
  • integrate & code
    • API calls
      • Configure your API integration
      • Advanced API features
      • V1 API Reference
      • Custom integrations 101
    • Code editor
      • [Example] Sending data to Airtable (POST)
      • [Example] Retrieving data from Airtable (GET)
      • [Example] Making SOAP requests
    • App integrations
      • Airtable
      • Freshdesk
      • Freshdesk Messaging
      • 🆕Gmail
      • Intercom
      • Mailgun
      • OpenAI: GPT-3, ChatGPT and GPT-4
      • Salesforce
      • 🆕Slack
      • Topdesk
      • Zendesk Support
      • Zendesk Sunshine (beta)
    • 🆕Expression syntax
    • Human handover & live chat
      • Sinch Contact Pro
      • #Interact
      • Genesys Cloud
      • Offloading Webhook
      • Salesforce Service Cloud
      • Sparkcentral by Hootsuite
      • Zendesk Chat
    • Chatlayer messages specifications
  • Publish
    • Publish your bot
      • Publish a flow
  • Analyze & maintain
    • Analytics definitions
    • Data retention
    • Maintenance
    • Session
    • Track events for analytics
  • VOICE
    • 🆕Send bot response as audio
    • Voicebots
      • Create a voicebot
      • Voicebot-specific actions
      • Test your voicebot
      • From chat to voice
  • access & support
    • Identity & Access
      • Single Sign-On (SAML SSO)
    • Billing & subscription
    • Get in touch
    • Chatlayer glossary
    • SaaS Regions & IP Ranges
    • Status
    • Debug your bot
      • No correct response
      • Collect input not working
      • Video isn't working
Powered by GitBook
On this page
  • Choose your integration
  • API plugin
  • Chatlayer v1 REST API
  • Code Editor
  • Webhook channel
  • How to start
  • Integration FAQ

Was this helpful?

  1. integrate & code
  2. API calls

Custom integrations 101

Integrations with Chatlayer, how does it work?

PreviousAdvanced API featuresNextCode editor

Last updated 11 months ago

Was this helpful?

Would you like to start your integration journey with Chatlayer? Great choice!

This page will help you to get started and guide you in the right direction.

Choose your integration

Chatlayer offers multiple ways of integration, all with their own possibilities.

API plugin

The API integration is an integration that allows you to make API calls to your server and process the result as responded by your server. You can find this in an Action block > API.

You can best use API when you want to make an API call to your server for the following use-cases:

  • To easily create a GET or POST request with only filling in the headers and parameters.

  • When you want your server to respond to a particular message.

  • When you want to get details to be stored in the session from your server.

  • Integrate with your own API where you can make changes if need be.

You should have your own service when you want to set this up. The service/API should respond in the same format as Chatlayer expects. The format that Chatlayer expects can be found . For more information about API integration visit .

Chatlayer v1 REST API

One of the most common use cases of using the Chatlayer (REST JSON) API would be to integrate Webhook channel. We also provide a variety of service via our API some of which are:

  • Get all conversations

  • Get all messages in a conversation

  • Send messages

  • Set session

  • Pause/unpause the bot

  • Trigger a specific block of the bot

  • Extract the NLP for an expression

While making request to chatlayer API, Chatlayer expects a bearer token to be passed for the authorization. In case of unauthorized token, we respond with 401 Unauthorized status code.

Some of the endpoints are rate limited and those can be figured out by checking the headers as defined below:

HTTP/1.1 200 OK
x-ratelimit-limit: 1200
x-ratelimit-remaining: 1199
x-ratelimit-reset: 1609459200000
  • x-ratelimit-limit - the rate limit ceiling that is applicable for the current request.

  • x-ratelimit-remaining - the number of requests left for the current rate-limit window.

  • x-ratelimit-reset - the time at which the rate limit resets, specified in UTC epoch time (in seconds) code editor

The example request samples can be seen on the right side of the page for each request. Some of the sample responses can also be seen on the bottom right of page.

Code Editor

In the code editor, you can easily add your custom code (in JavaScript) to the flow of the bot. You can use this plugin to make custom API calls to your or third party servers to manage and display the response that is sent back. This is a very versatile tool that we provide which helps you to add custom logic on the bot.

To start building with this integration, you need nothing more than (basic) Javascript knowledge.

You can best use Code editor if you want:

  • Custom logic to be added into the bot, deciding where the flow should go next. This can also be done with Go Tos, but the code editor allows for more complex conditions than the Go To.

  • To use the response sent by the server during an API call and want to first analyse the data sent by the server before further processing it.

Webhook channel

The Webhook channel is best used when you want to use our amazing NLP engine and the bot flow that is provided by the Chatlayer along with your own custom page that handles the chat UI. Webhook integration can also be used if you want to integrate a bot in Chatlayer with another bot that you have running somewhere else.

The concept behind this integration is that Chatlayer will work behind the scenes to process your queries and then once the query is processed, Chatlayer will call your API with the result. This makes this integration more lightweight and can be easily integrated with other channels . For the processing intensive tasks, you do not have to keep waiting for the response from Chatlayer as we will call your own API URL when the processing is done.

You can activate Webhook channel in the 'Channels' page on the platform. All you have to do is provide the URL where we need to make the API call when the webhook request is processed.

How to start

You now have chosen which integration type is best for your bot, great!

Now, you will need to start mapping out what your integration will look like.

For every integration, except the Webhook channel, it is important to visualise which information you first need to collect from the user before you send it to the external system. For example, when creating a ticket in an external ticketing system, first decide which variable you need, such as category, description, email address etc. Then, make sure all these variables are sent over correctly to the external ticketing system.

With response integrations, you would need to visualise what you would like to do with each response from the external system. Which responses can you receive from that system? Is there a certain logic, that response X leads to a different block in Chatlayer than response Y?

Asking yourself these questions beforehand, and preparing your integration to cover all scenarios, will make it easier to build your integration on Chatlayer.

Integration FAQ

Here you can find some frequently asked questions about our integration options:

What is the difference between the Webhook API and the Chatlayer API?

Chatlayer API works as request and response format, so a request is sent to the external system and a response is sent back.

The Webhook API works as an event triggering system where, when the processing of certain request is complete, we do an API call to your system with the data that you expected from the previous call.

Which language do you support in Chatlayer?

Our code action bot dialogs allow you to execute a JavaScript script during the bot flow

Do you have a swagger file?

Our own REST JSON API, as described in our , can be used to make the API calls to Chatlayer and can be used as another way to integrate your service to Chatlayer.

Send user messages coming from your

You can expand all the request body schema to find all the schemas of the objects that can be sent in as the request to the Chatlayer API as shown in the image below and .

To integrate with third-party API, for example in an external ticketing system

For some examples on how to use the code editor, check out this or example.

For more information about Webhook channel visit .

We do have a swagger file! The content of the swagger file is deployed .

here
this page
API documentation
Webhook channel
on this page
creating a ticket
POST
GET
this page
here