Docs

Facebook Messenger Quickstart

Overview

Create a Facebook page and an app

If you already have a Facebook page or an app you can skip the respective steps. The first things you need in order to send a notification is a Facebook page and an app. You can create a page in the top right corner of your Facebook profile.

image2018-6-14_10-22-24.png

Next we need to create an app for this page. Open the Facebook Developer portal and create a new app or select an existing one.;

image2018-6-14_10-24-12.png

Select Website and Skip the rest of the quick start by clicking the button in the top right corner.

Skip_Facebook_app_quick_start.width-800.png

Take a note of your App ID and App Secret, we will use it later.

image2018-6-14_10-27-23.png

Next add Messenger as a product to your app by clicking Add product on the left hand side menu and select Messenger.

Generate a Facebook access token by selecting your Facebook page in the Token Generation section.

Generate_Facebook_access_token.width-800.png

Take note of your Access Token you will need it soon.

Add pages_messaging permission request to your submission. You do not need to submit your app for review but you do need to add this request to your configuration.

Add_pages_messaging_permission.width-800.png

 

We are done for now with setting up Facebook. Send to support@apifonica.com the following info:

  • account_sid
  • auth_token
  • app_id
  • app_secret
  • access_token (which expires: never)

In reply you'll receive:

Now we can add the server as the webhook destination.

Copy the Webhook URL and webhook_page_marker. Click Setup Webhooks and complete the form.

image2018-6-14_11-36-51.png

Finally make sure to subscribe your new webhook to the page that you just created.;

webhooks.PNG

Now you are ready to test your new website that collects people's consent for receiving Facebook Messenger messages.