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.
Visit Facebook for Developers page and create a new app.
- Select a Messenger application
Scroll down to Token Generation
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.
Click Setup Webhooks
to link this application to your Botkit instance.
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.
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!