Let's look at the Bot API in some different workflows.
- Bot-only workflow
- Handoff to Khoros Care agent workflow
- Facebook handover protocol workflow
All workflows assume that the bot has already been registered with Care using POST /bots/networks/networkType/registrations.
This diagram shows the API workflow for a conversation started and resolved entirely by a bot. It uses the POST /bots/networks/networkType/authors/authorId/resolve endpoint.
This next diagram shows the API workflow for a bot-initiated conversation that is handed over to an agent. The flow uses the POST /bots/networks/networkType/authors/authorId/handoff endpoint, which makes a callback to the bot (described in API callbacks to bots) when the agent resolves and closes the conversation.
When using Facebook Handover Protocol, you will not use Khoros's Bot API to make the handoff. See Bot API workflow with Facebook Handover Protocol for details.
The Bot API supports the Facebook Handover Protocol. This is the protocol used when handing a Facebook conversation from a bot to a Care agent. Use the Facebook Handover Protocol when working with Facebook entities rather than using the Bot API
/bots/networks/networkType/authors/authorId/handoff call. The following diagram illustrates the handoff flow with Facebook Handover Protocol.
Khoros Care supports Facebook's Pass Thread Control API, but not the Facebook Take Thread Control or Request Thread Control APIs. Also, when using the Facebook Handover Protocol, the conversation ID for the conversation handed off from the bot to the agent is not returned, as it is with the Care handoff API.
Be sure you are registering your Facebook Messenger bot with the correct App ID. This is App ID associated with your bot and the App that has the Primary Receiver role assigned.
The Facebook documentation describes how to enable the Facebook Handover Protocol for your app. In addition, Khoros must also perform some configuration in Care.File a Support ticket if you intend to use the Facebook Handover Protocol.