Getting Started : Facebook Susi AI Bot Installation¶
It’s easy for you to create your own facebook messenger bot and integrate susi’s API into it. You can read the documentation as prepared by the Messenger team.
Messenger bots uses a web server to process messages it receives or to figure out what messages to send. You also need to have the bot be authenticated to speak with the web server and the bot approved by Facebook to speak with the public.
Setup your own Messenger Bot¶
- Fork this repository.
- Create a facebook page here.
- Create a new heroku app here.
- Connect the heroku app to the forked repository.
- Deploy on development branch. If you intend to contribute, it is recommended to Enable Automatic Deploys.
- Create or configure a Facebook App or Page here
- Get started with Messenger tab in the created app.
- In the Page Access Token select the fb page that you created and generate the token and save it somewhere for future use.
- Now, go to the heroku app, select the settings tab and add the environment variable as shown, where key is FB_PAGE_ACCESS_TOKEN and value is the token generated in the previous step.
- Create a webhook on the facebook app dashboard. The Callback url should be https://
>.herokuapp.com/webhook/ and rest should be as shown in the image below.
- Go to Terminal and type in this command to trigger the Facebook app to send messages. Remember to use the token you requested earlier.
curl -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<PAGE_ACCESS_TOKEN>"
- Go to the facebook page created and locate ‘Message Now’ or go to https://m.me/PAGE_USERNAME
- Enjoy chatting with Susi.