Facebook (Meta) MessengerΒΆ

The Facebook Messenger Endpoint enables you to connect AI Agents to the Facebook Messenger platform.
PrerequisitesΒΆ
- A Facebook account.
- Access to Facebook (Meta) Messenger.
- Access to the Facebook (Meta) Developer Center.
Generic Endpoint SettingsΒΆ
Learn about the generic Endpoint settings on the following pages:
- Endpoints Overview
- Data Protection & Analytics
- Transformer Functions
- NLU Connectors
- Session Management
- Handover Settings
- Real-Time Translation Settings
- Inject and Notify
Specific Endpoint SettingsΒΆ
Facebook Page Setup
Parameter | Description |
---|---|
Facebook Page Access Token | A token generated by your Facebook App to authenticate the connection with Cognigy.AI. |
App ID | The App ID of your Facebook App. |
App secret | The App Secret of your Facebook App. For additional security, it verifies that messages are sent from Messenger. |
Facebook Profiles
Parameter | Description |
---|---|
Request profile data | Fetches data from the user's Facebook profile and stores in the ci.data.profile object. The ci.data.profile object will contain the following parameters:
Note that the same data types are exposed in the profile object for every Facebook user. However, the actual values depend on the information available in their Facebook profile and on their privacy settings. |
Update contact profiles | Updates the Contact Profile in Cognigy.AI with data from the user's Facebook profile. If the setting is enabled, the information a Facebook user has on their profile will be copied to their Contact Profile. |
Merge contact profiles | Each Facebook user has a user's PSID for each Facebook Page they interact with. This means that if you own two or more Facebook Pages, you can't immediately identify users across these pages because they will have a different ID for each page. However, if you enable this setting, Cognigy.AI will fetch all of a user's PSIDs for your pages and merge these profiles into one. This setting allows you to easily identify a single user across all your pages and personalize the chat experience more effectively. To perform the necessary API calls to get all the PSIDs for a user, the same Business must own all the Facebook Pages. |
Messenger Settings
Parameter | Description |
---|---|
Enable typing indicators | Enables a typing indicator while the bot is replying. You can configure whether typing indicators should be used and how many milliseconds of delay there should be between each message. |
Message Delay | The amount of time to wait between sending bot replies, in milliseconds. |
How to Set UpΒΆ
1. Create a Facebook Page and a Facebook App
- Log in to your Facebook account. Go to the Pages section.
- Click Create New Page, select a type (Business or Community), and provide a name and category.
- Go to the Facebook (Meta) Developer Center.
- Click Manage Apps, then Add a New App.
- Fill in the required details to complete the app creation.
- In your app's product overview, locate Messenger and click Set Up.
2. Generate a Page Access Token
- Go to Messenger > Access Tokens. Add the Facebook Page created earlier.
- Click Generate Token, acknowledge the warning, and copy the token.
3. Create a Messenger Endpoint
- In the left-side menu of the Cognigy.AI Project, go to Deploy > Endpoints.
- On the Endpoints page, click + New Endpoint.
- In the New Endpoint section, do the following:
- Select the Messenger Endpoint type.
- Add a unique name.
- Select a relevant Flow from the list.
- Open the Facebook Page Setup section. Paste the Page Access Token from the Facebook App.
- (Optional) Enter your App ID and App Secret for additional security.
- Copy the Endpoint URL for later use.
4. Configure Webhooks
- Go to the Facebook app. Under Messenger > Webhooks, click Add Callback URL.
- Paste the Endpoint URL as the callback URL.
- Enter the Verify Token from Cognigy.AI:
- For
https://trial.cognigy.ai
, use the token6a1ed94ef26462d1a529ab80afabe135e5ac7cc8b414ef762e1208f3339f887196d3433c996c0f30ea15295fbd86293cd7516abaa9b9e78d641ebb514eea32b4
. - For other environments, contact Cognigy technical support for more information.
- For
- Click Verify and Save.
- Add Subscription Fields: select
messages
,messaging_postbacks
, and optionallymessaging_referrals
. Save the settings.