Let’s get started with Facebook Messenger! Follow these steps to be up and running in no time! The first part of this guide will explain how you can set up a testing/personal-use Bot, this takes less than 5 minutes. The second part will explain how you can submit your Bot for use in production.
Update 26/03/2018 14.30 CEST: Please note Facebook is reviewing the use of their platform by third-parties. This means that currently they are not accepting new apps for review. This may change at Facebook's discretion and is out of our control. You can check here for more information from Facebook.
- Go to https://developers.facebook.com/apps/.
a. Click on your Username in the top left, and select 'Create New App'.
b. In the next pop-up you can choose for Basic Setup. Fill out the short form that’s presented, and then click ‘Create App ID’.
- After submitting this form you’ll be taken to an overview page with various products you can set up.
a. Before jumping into this, navigate to ‘Settings’ in the left sidebar.
b. Click on ‘Show’ and you will see 2 values: AppId and AppSecret. Write these down somewhere as we will need them later.
- Click on ‘+ Add Product’ under ‘Products’ in the left sidebar.
a. Click on ‘Get Started’ to the right of the ‘Messenger’ bar.
b. You’ll be redirected to the Messenger page, which has now appeared on the left under 'Products'.
- Scroll down to ‘Token Generation’, and select the Page you’d like to link to Chat API.
a. After going through the Facebook Auth flow, a Page Access Token will be generated. Note this as well.
- At this point, you can go back to the MessageBird Dashboard.
a. Fill in the AppId, AppSecret and Page Access Token you wrote down earlier.
b. The only required open fields now is Page Id.
c. The Page Id is the ID of the page you’ll be adding to the Chat API. You can find the Page ID of any page here: http://findmyfbid.com/.
e. The Verify Token will be a prefilled token which is needed in step 7. Write this one down.
- Once you’ve filled this in you can click on ‘Add’ and the Channel will be connected to your account!
- Last step, head back to Facebook Developers.
a. Go to the ‘Webhooks’ section just below 'Token Generation'.
b. Click on ‘Setup Webhooks’ on the right. This will present you with a pop-up form.
c. The URL you’ll have to fill in here is https://chat.messagebird.com/facebook/webhook/<appId>.
d. Where it mentions <AppId>, you have to fill in the AppId you wrote down during Step 2.
e. Apart from the URL you’ll also have to fill in the Verify Token you received from us at Step 5-e.
f. All Subscription Field checkboxes must be checked. After this you can click on ‘Verify and Save’.
g. After this, select a page to subscribe your Webhook to. Do this by selecting the correct page in the dropdown and clicking on the blue ‘Subscribe’ button.
Done! You’ve just created and connected a Facebook Page to the Chat API. Now, you’re all set to send the first message to your Facebook Messenger Bot. Be aware that your current App is still in testing mode, so only you and the testers specified under the ‘Roles’ section in the left sidebar can actually use this Messenger integration.
Once you are ready to use your Messenger Bot in production, you will have to submit it for review. To do so, follow these steps:
- Go to https://developers.facebook.com/apps/ and click on the App you want to use for Chat API and in production. In the left sidebar, click on ‘App Review’.
- On the ‘App Review’ page click on the ‘Start a Submission’ button.
a. In the pop-up, select ‘pages_messaging’ and then, click on the blue ‘Add 1 Item’ button in the bottom right corner.
- You may be presented with a list of issues that must be resolved before you can submit the App for review - this could include anything from a Privacy URL to a missing App Icon.
- An important step to complete requires that you visit the ‘Settings’ page in the left sidebar.
a. Here, click on ‘+ Add Platform’ at the bottom.
b. Choose ‘Website’ as your platform, then simply enter the URL of your website.
c. After this you can go back to the ‘App Review’ page.
- The most important hurdle before you can submit the App can be found under ‘pages_messaging’ in the submission overview.
a. Here, click on ‘notes’ in the ‘Complete the notes for this item before submitting.’ text below pages_messaging.
b. After clicking on ‘notes’, a pop-up form with questions about the goal of your Bot will appear. You’ll also have to upload a screencast of how the App should work. This is obligatory and must be done well, as Facebook will really test your Bot and reject it if it doesn’t meet the description and screencast you provide.
- When you’ve filled in all the information and uploaded the screencast, click on ‘Save’, which will allow you to click on the ‘Submit for review’ button.
- When you click on ‘Submit for review’, you’ll be asked to accept Facebook’s Terms & Conditions. The last step is to click on ‘Submit’.
Facebook says they review all submissions within 2 weeks, but it often takes less than that. Be aware of the fact that they can reject your submission if it doesn’t meet the Facebook Messenger guidelines or doesn’t match the functionality as described and shown in the screencast. Even though we have no influence on this process and their decision, we are happy to help you out if something doesn’t work out. Just send us an email at firstname.lastname@example.org.