Facebook Messenger platform enables developers to automate replies on the public pages and create chatbots for Messenger. Every visitor of your business page can contact with your bot with a single click on the "Contact us" button.
How to create Facebook bot
First of all you have to create a business page on Facebook and then connect a bot to it. Please follow the next steps to connect your Aimylogic's bot to your business page on Facebook.
Step 1. Create a public page
Click on the menu in the right top corner and select "Create Page". Select a page type, define the name of the page and pick a category.
Step 2. Create an application
Register a new Facebook application on https://developers.facebook.com/apps. Your bot will use this application.
Step 3. Add Messenger to the application
Click on Products in left menu and then in "Set Up" in the Messenger panel.
Select your public page in "Token Generation" panel. Copy the token that appears after that.
Step 4. Create a Facebook channel in Aimylogic
Click on the Channels menu in Aimylogic and then click in Facebook. Paste your token and click on Connect button. Then click on "Get Webhook" button. A Webhook URL will be copied to your clipboard automatically.
Step 5. Add Webhook to Facebook application
Click on "Setup Webhooks" and paste Webhook URL in the field named "Callback URL". In "Verify token" type justai_verify_token. Check "messages" and "messaging_postbacks" checkboxes. Then click on "Verify and Save".
Step 6. Subscribe Webhook to the page events
Select your public page in "Select a page to subscribe your webhook to the page events" field. Then click on "Subscribe".
Step 7. Test your bot
Go to your public Facebook page and try to send some message. Your bot should reply according the scenario in Aimylogic. Now your bot is visible only for you. To publish it worldwide you have to submit it to review and receive an approve from Facebook team.
Step 8. Submit app to review
In application settings go to "App Review for Messenger" section and add pages_messaging to submission. Submit your application and wait a couple of business days for an approval from Facebook team. Once an approve is received, your bot becomes available for all Facebook users.
Published on: 08 / 10 / 2018