# Messenger

{% hint style="info" %}
If you don't already have a Facebook page for your application to connect to, create one on Facebook (*<https://facebook.com>*). Once your page is in place, set up Messenger before creating a channel.
{% endhint %}

### Set up Messenger&#x20;

To generate the other necessary properties to get your application up and running with *Messenger*, first create a Messenger product:

1. Navigate to your *Facebook App* on [https://developers.facebook.com](https://developers.facebook.com/). Scroll down to the *Products* section and choose Messenger for Set Up

### Generate Page access token

2. On your *Facebook App*'s page, click *Add or Remove Pages*

![Facebook App page](https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2FN5SegHTb2cdptTtShViU%2FFacebookAddRemovePages.jpg?alt=media\&token=d1b8f30b-f4df-46db-9194-acf733689b65)

3. Navigate to your app's page and choose the Facebook page you want to link your application to
4. Follow the steps in the pop-up
5. After the page is added, click *Generate Token*
6. Copy the token from the popup > Click *Done*

### Generate Verify token

7. You may use any method to generate this string. We recommend using a password generator such as <https://www.lastpass.com/password-generator>

{% hint style="info" %}
For security, make sure the Verify token is at least 32 characters long.
{% endhint %}

### Add channel to app

8. Select *Configuration* tab of your application in your NLX workspace
9. Choose *+ Add channel* under *Delivery* section > Choose *Messenger*
10. Click *Create channel*
11. Click *Save*
12. Create a [build and deploy your application](https://docs.nlx.ai/platform/nlx-platform-guide/setup#deployment)

### Post deployment

13. After deploying your application, make note of the application's URL by expanding the *Details* link beside your Deployed status. Expand the Messenger section in the popup modal > Copy the *Bot URL*
14. On your Facebook App's page, scroll to the *Webhooks* section > Click *Add Callback URL*
15. Enter the bot's URL into the *Callback URL* field. Then enter the *Verify token* value you created into the *Verify Token* field&#x20;

![](https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Ftestnlxstudio%2F-Ma-dteIf1NZlh-odbxn%2F-Ma-eGsPbozUDY6Apll7%2F5.png?generation=1621361238011254\&alt=media)

16. Click *Verify and Save*
17. On your *Facebook App's* page, scroll to the *App Review for Messenger* section > Select to add the *pages\_messaging* permission


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nlx.ai/platform/nlx-platform-guide/ai-applications/deployment/managing-channels/creating-a-messenger-channel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
