Activating Fallback

When your bot doesn't know how to handle a user input, you can choose to place the bot in stand-by, and route all further messages from this user to a fallback channel. An admin will be able to take over from the bot, and respond to the user directly.

How to create a fallback channel?

In your bot, go in the Run > BotConnector tab, then click on Fallback channels. From there, you can create a fallback channel easily on your favorite support platform by following the instructions.

How to activate the fallback on a conversation?

Once you have created a fallback channel, you can choose to activate it and deactivate it for each conversation from your code. Once the fallback has been activated for a conversation, your bot won't receive messages from this conversation anymore. Instead, the messages will be redirected to your fallback channel, where an admin will be able to answer.

How to deactivate the fallback on a conversation?

The conversation will be automatically restarted with the bot once the admin closes it. If you want more control, you can deactivate it manually by making an HTTP request on the route exposed below.

Activate the fallback for a conversation

POST https://api.recast.ai/connect/v1/conversations/:conversation_id/fallback/activate

JS
const recastai = require('recastai')

const connect = new recastai.connect('YOUR_REQUEST_TOKEN', 'en')

connect.activateFallback('CONVERSATION_ID')
  .then(res => console.log(res))
  .catch(err => console.log(err))

Deactivate the fallback for a conversation

POST https://api.recast.ai/connect/v1/conversations/:conversation_id/fallback/deactivate

JS
const recastai = require('recastai')

const connect = new recastai.connect('YOUR_REQUEST_TOKEN', 'en')

connect.deactivateFallback('CONVERSATION_ID')
  .then(res => console.log(res))
  .catch(err => console.log(err))