Facebook Messenger configuration steps
If your chatbot is running in Facebook Messenger you will need to configure EngageOne™ Communicate Chat with the following information from your Facebook for developers page.
- You will be copying information from Facebook for developers to EngageOne™ Communicate Chat, so it may be best to have an instance of each open side-by-side.
- What you see on screen may not exactly match what is shown here, depending on updates made to Facebook since this help was published.
The following instructions assume that you have already registered for a Facebook and "Facebook for developers" account.
Step 1: Initial setup in Facebook
In this step, you add the Messenger Platform and configure the webhook:
- If you do not have one set up, create a Facebook page that corresponds to the Communicate bot.
- From the Facebook for developers page (https://developers.facebook.com), click My Apps > Add a New App.
The Create a New App ID window displays.
- Enter the app display name, then click Create App ID. Then fill in other information as required and complete the security check.
The App Dashboard is displayed.
- In the Messenger box, click Set Up.The Messenger Settings page is displayed.
Scroll to the Token Generation section. select your page from the Page field.
Note: If you do not have a page, click Create a new page.- If required, grant permissions for the page token.
- Copy the Page Access Token.
Step 2: Configure the bot in EngageOne™ Communicate
- In Designer, click Bot Settings to display the bot configuration. Open the Integration tab.
- Paste the page access token into the Page Access Token field.
- From the Facebook for Developers App Dashboard, copy the App ID (located at the top of the window) and, in Communicate, paste it into Page ID field.
- From the Facebook for Developers App Dashboard, go to Settings > Basic. Click Show under App Secret and copy the app secret.
- In Communicate, paste the app secret into the App Secret field.
Type a word or phrase in the Verify Token field.
Note: Take note of your word or phrase; you will enter the same in Facebook for developers.- Click OK to save the bot configuration.
- Go back to the Integration tab again. The Callback URL field is now populated with a domain appended with a token string. For example:
https://chatrunner.eu-west-2.converse.engageone.co/api/v1/sa20d32/bots/facebook/Chat Facebook Integration
- Copy the information in the Callback URL field.
Step 3: Configure the webhook in Facebook
- From the Facebook for Developers App Dashboard, go to Messenger > Settings. Scroll down to the Webhooks section.
- Click Setup Webhooks.
The New Page Subscription window is displayed.
- Paste the Callback URL you copied from Communicate into the Callback URL field.
- In the Verify token field, type the word or phrase that corresponds to the token in Communicate.
- In the Subscription Fields section, select the appropriate options for your bot.The Messenger Platform sends events to your callback URL to notify your bot when a variety of events happen. All webhook events are optional but the relevant ones for Communicate are as follows:
messages
messaging_postbacks
message_deliveries
message_reads
messaging_account_linking
For further information, see https://developers.facebook.com/docs/messenger-platform/webhook/#subscribe.
- Click Verify and Save.
The Webhooks section (under Messenger settings) displays.
- In the Select a page to subscribe your webhook to the page events field, select your Facebook page.
- Click Subscribe.
You are ready to start building your bot in EngageOne™ Communicate.
Developing the bot in EngageOne™ Communicate Chat
When developing the bot, remember that a message or question interaction that makes a call to Facebook must have used the Requires Account Linking option. This is set on the Advanced tab of the interaction.
For more information, see Creating an interaction for account linking.