Integrate Chatlayer with your backend or 3rd-party services to share data with the bot, or enrich the bot with captured data.
Chatlayer offers a solution to integrate your conversational agent with your backend logic, APIs, and databases. This enables you to create contextual, personalized, and actionable conversational experiences for your users.
API integrations with Chatlayer
How API integrations work.
Please note that the term dialog state refers to the same thing as block, in the context of development tools.
How API integrations work on Chatlayer
A user types and sends a text message from a conversational agent interface channel (like Facebook Messenger, Web chat, etc) to Chatlayer.
The received message is going through Chatlayer’s NLP engine to detect the intent and the returned intent combined with user context will be used to retrieve the next block in the conversation.
Chatlayer’sAPI step can be added in a block to send an API request to your server with different types of static data and/or user session data.
Your server can respond with an object with 3 fields:
session: a session object for saving retrieved user session data.
messages: an array of messages to send back to the interface channel.
nextDialogstate: a block state identifier to redirect the user to a next block in a conversation flow.
Session data will first be stored in the user session so that you can use this data in messages defined in the array of messages or in messages defined in a dialog state defined as nextDialogstate in the API response. Second, messages will be sent, and afterwards the user is redirected to the nextDialogstate. All fields are optional.