Skip to content

Configure your bot for Messenger

If you followed the guide Create your first bot with Tock Studio, you declared a Slack-type connector.

In this guide, you will create a configuration for Facebook Messenger and integrate the bot to communicate with it on this social network.

If you wish, you can also skip this step and go directly to the rest.

What you will create

  • A configuration (in Facebook and in Tock) to receive and send messages via Messenger

  • A bot that speaks on a Facebook page or in Messenger

Prerequisites

Create a Facebook page

  • Create a Facebook page

Create a page part 1

Create a page part 2

  • Give it a name (e.g. My Tock Bot)

create an app part 3

Recommendation: do not publish the page to limit its access to Messenger users: Settings > General > Page visibility > Not published

Create a Facebook application

Créer une application partie 1

Create an app > Manage professional integrations

Créer une application partie 2

  • Enter a name for the application Créer une application partie 3
  • Add a product: Messenger

Ajouter messenger à une application partie 1

Add messenger to an application part 2

Create a Messenger connector

  • In Tock Studio go to Settings > Configurations :

Create a messenger connector part 1

  • Create a connector of type Messenger and open the Connector Custom Configuration section

Create a messenger connector part 2

  • Complete the fields (see below field by field):

Connect Tock part 1

Trouver l'id d'application

ID de page partie 1

Page ID part 2

Créer une application partie 1

  • Webhook Token : choose any token (even token if you want) and write it down for later - every call to Tock from Facebook will be made passing this token

  • Secret : copy from your user's page application on https://developers.facebook.com

Créer une application partie 2

  • Persona Id : you can leave this field empty

  • Check that the connector configuration is saved

Configure the callback URL

  • Go back to your app's configuration page on https://developers.facebook.com: Products > Messenger > Settings > Webhooks

  • Click Add Callback URL (or Edit Callback URL if you previously had a different URL)

  • Enter the URL where your Tock connector is currently deployed, and the webhook token you chose when configuring the connector

To find your connector's URL, go to the Tock Studio > Settings > Configurations configuration page, expand your Messenger connector configuration, and concatenate the contents of the Application base url field and the contents of the Relative REST path field.

  • Click Review and save

  • Test your bot on Messenger!

Congratulations!

Your bot now communicates on Messenger, in addition to the other channels you have integrated it into.

The conversational model, features and personality of your assistant are built and remain independent of the channels on which the bot is present. However, nothing prevents you from creating paths or responses specifically for a particular channel, as you will see through different Tock tools: Responses management screen, activation of intentions on a particular channel with the Story Rules screen, use of DSLs and the Bot API to take advantage of specific graphical components, etc.

Continue...

In the following sections you will learn how to:

To learn more about the Messenger connector provided with Tock, go to the connector-messenger folder on GitHub, where you will find the sources and the README of the connector.

Chat with Tock
×