Facebook Messenger Quickstart
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.
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.;
Select Website and Skip the rest of the quick start by clicking the button in the top right corner.
Take a note of your App ID and App Secret, we will use it later.
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.
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.
We are done for now with setting up Facebook. Send to firstname.lastname@example.org the following info:
- access_token (which expires: never)
In reply you'll receive:
- Webhook URL: www.api.apifonica.com/webhook/acc5035f2b5-0520-4ee5-ba08-c6acb6222141
- webhook_page_marker : 1758
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.
Finally make sure to subscribe your new webhook to the page that you just created.;
Now you are ready to test your new website that collects people's consent for receiving Facebook Messenger messages.