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
  • Clear Session
  • Send to offload provider
  • API
  • Code
  • iframe
  • JSON Builder

Was this helpful?

  1. Bot answers
  2. Bot dialogs

Action

PreviousInput ValidationNextTranslations

Last updated 4 years ago

Was this helpful?

Clear Session

Often, at the end of a flow, an API backend call will be configured to, for example, save a train ticket in the ticket ordering system. Afterwards users should be able to book a new ticket to a different location.

You can achieve this with the clear session action. This action removes the values of set session variables. This is useful when a user asks to correct a value, or to start over and delete all variables.

Send to offload provider

A user that reaches this action will be offloaded to a human customer support agent. For this to work you need to enable offloading.

Depending of your selected offloading provider additional configuration may be required.

API

Code

iframe

A basic example would be the following :

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        </head>
        <body>
            <button onClick="window.parent.postMessage(JSON.stringify({target:'CL_API',type:'SEND_MESSAGE', payload:{text: 'You clicked the button'} }),'*')">
         SEND_MESSAGE
        </button>
        </body>
</html>

If this code is hosted and embedded in the iframe plugin, when a user clicks the button, it will send a user message to the chat.

The postMessage API can also handle UPDATE_SESSION and GO_TO_DIALOGSTATE events.

JSON Builder

This action is used to integrate back-end services into your Chatlayer.ai bot. More details can be found in the tutorial .

Use the code editor to apply custom logic and functions to your flow, using Javascript. Click on the hamburger menu on the right to include some examples in your editor. You can find a tutorial about the use of the Code action .

An iframe is a custom element that can be used to show a different webpage in the chat conversation. It can also be used to communicate with the parent window through the .

If your bot is published on the channel, you can use the JSON Builder action to send messages to the conversation that don't need to result in an actual message to the user. Typically, it's used to send information about the user or bot conversation to the website the bot is published at.

here
here
postMessage API
Webhook API