Events from the bot

Send Events from your bot

Listen to events from your Bot; this is useful to make your website react to the ongoing conversation on the webchat.

Built-in Events

There are Built-In events you can use to customize the behaviour of your application.
Here is a comprehensive list of the predefined events on the platform:

EventDescriptionPayload
CLSTR_WEBCHAT_INITIALIZEDWebchat initialized and interlocutor created.null
CLSTR_USER_OPENED_CHATThe webchat window has been opened by the user.null
CLSTR_USER_CLOSED_CHATThe webchat window has been closed by the user.null
CLSTR_USER_REPLIEDThe user sent a reply to the bot in the webchat.Last reply send by user, as a string.
CLSTR_USER_INTERACTEDThe user interacted with the webchatLast reply send by user,
Last button clicked by the user
Last menu item clicked by the user
format :
{ type: string, label: string }
CLSTR_BOT_SWAPPEDThe bot was successfully swapped.Bot id of the new bot, as a string.
CLSTR_USER_SWAPPEDThe user was successfully swapped.User Id of the new user, as a string.
CLSTR_USER_AUTOCOMPLETE_SELECTEDThe user used autocompleteLabel of the autocomplete selected
CLSTR_USER_LINK_CLICKEDThe user clicked on a link ( text or card )Url and label of the link.
format :
{ url: string, label: string }

Custom Events

Use the Send Event action to send a custom event from one of the steps of your stories.

When listening to the event, take care of using the exact same syntax as the one configured on the Send Event action of your bot.

704