> For the complete documentation index, see [llms.txt](https://docs.1millionbot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1millionbot.com/chatbot/channels/facebook-messenger.md).

# Facebook Messenger

## Set up

> Meta frequently updates and redesigns its developer console, so the steps and menu names in this guide may become outdated. If something doesn't match what you see on screen, check Meta's official, always up-to-date documentation: [Messenger Platform](https://developers.facebook.com/documentation/business-messaging/messenger-platform/overview).

To set up your agent integration in Facebook Messenger, you'll need the following:

* A Facebook account registered in the [developer console](https://developers.facebook.com/).
* A Facebook page connected to Meta Business.

### Create a Meta App

> Meta assigns "use cases" when creating the app: Messenger is no longer activated by looking for the product in the Dashboard, but by selecting a dedicated use case during the app's own creation.

1. Access the [Meta developers console](https://developers.facebook.com/apps/).
2. Click on 'Create app'.
3. Enter the app name and a contact email.
4. On the use case selection screen, choose **'Engage with customers on Messenger from Meta'** and click 'Next'.
5. Select an existing business portfolio linked to your Meta Business, or create a new one.
6. Review the publishing requirements (they may appear empty at this point) and click 'Create app' to finish.

Once created, go to the app's **Dashboard** section, select that use case and click 'Customize' to configure it.

### Generate a Permanent Access Token

1. In the app's **Dashboard**, select the **Engage with customers on Messenger** use case and click 'Customize'.
2. In the **Generate access tokens** section, click 'Connect'.
3. Select the Facebook page you want to connect to the agent and click 'Continue'.
4. Click 'Save' and then 'Got it' to return to the Dashboard.
5. Copy the generated token for future use.

### Obtain the Facebook Page ID

1. In the app's **Dashboard**, select the **Engage with customers on Messenger** use case and click 'Customize'.
2. In the **Generate access tokens** section, copy the ID displayed below the connected page.

### Obtain the application secret key

1. Navigate to [Facebook developers console](https://developers.facebook.com/apps/).
2. Access to the created application.
3. Go the **Settings** > **Basic Information** menu section.
4. Click show and copy the application secret key.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-a09e32fc897be0d119fa9bc50195a2fe40507e58%2Fwhatsapp-cloud-2.png?alt=media)

### Connect your app with your agent

#### Activate integration in 1millionbot platform

1. Go to the **Channels** section on the platform.
2. Activate Facebook and click on 'Settings'.
3. Enter the previously obtained data: Application Secret Key, Permanent Access Token and Faceboook Page ID
4. Click on 'Save'.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-5f5ecb253496740afe3ccad26edd660372d9900b%2FFB_18.png?alt=media)

#### Activate integration in Meta

**Obtain the Callback URL**

1. Go to the 1millionbot platform and click on the 'Info' button in the Facebook channel to get the callback URL.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-833ea11b769e2543b00e181a6c94e571053023ce%2FFB_19.png?alt=media)

**Configure the Meta Webhook**

1. In the app's **Dashboard**, select the **Engage with customers on Messenger** use case and click 'Customize'.
2. In the **Configure webhooks** section, paste the Callback URL obtained from the 1millionbot platform and enter the Verify Token (the Permanent Access Token).
3. Click on 'Save'.

### Set permissions

1. On the same customization screen, click 'Add Subscriptions'.
2. Select the following fields:\
   \- *messages*\
   \- *messaging\_postbacks*\
   \- *messaging\_optins*\
   \- *messaging\_optouts*\
   \- *message\_deliveries*\
   \- *message\_reads*
3. Click 'Confirm'.

### Publish Meta app

1. While your application is in development mode, you can only test the agent's operation if you are the owner or have access (as an admin, developer, or tester) to the connected Facebook page.
2. Since the application only sends and receives messages on the page you connect yourself — not on third-party pages — Meta automatically grants **Standard Access** to the `pages_messaging` permission. This means **you don't need to submit the application for Meta App Review** to publish it: full review (Advanced Access) is only required when a single app needs to operate on pages you don't manage — for example, a platform serving many different clients' pages from a single app — which isn't the case for this integration.
3. To publish the agent for public interaction, complete any remaining information Meta requests in the app's Dashboard and switch the use case's status from "In development" to "Live".
4. Done! Once published, perform tests to verify the operation of your agent on the provided Facebook account. 🎉

## Limitations

* A maximum of (200 \* Number of Engaged Users) messages per day can be sent per bot.
* Buttons must have a maximum of 20 characters.
* Maximum of 3 buttons per message.
