Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Latest commit

 

History

History
52 lines (30 loc) · 2.5 KB

facebook_messenger.md

File metadata and controls

52 lines (30 loc) · 2.5 KB

Configure Botkit and Facebook Messenger

Note: This also applies for Facebook Workplace

Facebook is a constantly evolving platform, nominally you can find everything you need to create a bot on their platform page, but that information is subject to change.

Once installed, you will need to do steps 2-4, and steps 5 in parallel. It helps to have your development enviroment and the Facebook for Developers page open at the same time.

2. Create a Facebook App for Web

Visit Facebook for Developers page and create a new app.

Screenshot of create an APP ID in Facebook developer portal

  • Select a Messenger application

Screenshot of configuring your app in the Facebook developer portal

3. Get a Page Access Token for your app

Scroll down to Token Generation

Screenshot of page access tokens in Facebook portal

If you have not yet created your page yet, you can go ahead and do this now, or associate this new bot with an existing page.

Copy this Page Access Token, you'll need it when running your bot.

4. Setup webhooks

Click Setup Webhooks to link this application to your Botkit instance.

Screenshot of configuring webhooks in the Facebook portal

The callback url will be https://YOURURL/api/messages. This URL must be publically available, and SSL-secured. More information on this can be found in the next step.

You will also need to define a Verify Token for your page subscription. This is a user-defined string that you will keep secret and pass in with your environment variables.

5. Run your application

Run your application with your environment variables set:

  • page_token - Your Page Access Token (required)
  • verify_token - Your Verify Token (required)

If your application has been configured correctly, you will be able to talk to your bot through the page you specified in Step 3. Congratulations!

Additional resources