Integrating Chatbot with Facebook

AmplifyReach Facebook integration allows you to create a Facebook Messenger bot with natural language understanding, based on the AmplifyReach technology.

Setting Up Facebook

To set up the Facebook integration for your bot, you need following:

When a user visits your facebook page and sends you a message, they’ll be talking to your bot.

Create a Facebook App

  1. Log into the Facebook Developer Console.
  2. Click on My Apps in the upper right hand corner.
  3. Click on Create App and enter a name and contact email address.
  4. Click Create App ID. 
  1. A list of products will be shown.

  1. Please find “Messager” and click on “Set Up” button.

  1. Click Add or Remove Pages to select your fb page.
  2. Select Generate Token. This will generate a Page Access Token. Please copy this token, as you need to enter it in AmplifyReach Facebook Channel Configuration.

Setting up Facebook Configuration in AmplifyReach

  1. Go to Channels -> Facebook Messenger -> Configuration tab. Messenger. In the dialog that opens, enter the following information:
    • Enter Verify Token – This can be any string and it needs to be provided in Facebook settings in further steps
    • Page Access Token – Paste the token generated in the Facebook Developer Console for your page
    • Select Yes to enable Facebook Messenger.
    • Copy Callback URL. This needs to be provided in Facebook settings in further steps
  2. Click the Save button.

Note: Keep the Callback URL and Verify Token handy for configuring the webhook.

Webhook Configuration

To configure your bot’s webhook, go back to Facebook Developer Console:

  1. Goto Webhooks section and select Add Callback URL:
    • Callback URL – This is the URL provided on the AmplifyReach Facebook Messenger Configuration section. Copied in previous step
    • Verify Token – This is the token you entered in previous step
    • Select verify and save.
    • Select Add Subscriptions
    • Select messages and messaging_postbacks options, save.

Note: If you’re using rich messages, make sure the messaging_postbacks option is checked.

Testing

In order to make your bot available for testing, you need to make your App Live:

  1. Click on Settings in the left menu of the Facebook Developer Console.
  2. Click on the Basic under Settings. Add the basic details and Click the Save Changes button.
  3. Make your app public by switching the flag . 

You need to set a username for your page. This username will be shown in chatbot. To set the username, click the Create Page @Username link under your page’s profile picture and title. 

Note: You can make your app available for testing by adding testers to the app. To do this click on Roles in the left menu and then add people in the Testers section.