Connect Facebook to B6AI
Connect the Facebook channel end to end, set up Facebook, connect it in B6AI, publish your bot, and go live with confidence.
Overview
Connecting Facebook Messenger lets your bot answer messages sent to your Facebook Page, with handoff to human agents.
It’s a great channel for businesses with an active Page audience.
What you can do on Facebook
Connecting Facebook lets your bot hold real conversations there, with full handoff to human agents when needed. On this channel you can:
- Answer Messenger conversations with your bot.
- Send quick replies, buttons and carousels.
- Hand off to a human agent when needed.
- Use message tags for the limited set of allowed proactive notifications.
- Re-engage customers within the 24-hour window.
How the Facebook channel works
B6AI connects to your Facebook Page via a Meta app. When someone messages the Page, Meta calls a webhook at B6AI, which runs the bot and replies using a Page access token with the pages_messaging permission.
Prerequisites
Have all of the following ready before you begin, each is required to complete the connection.
- A Facebook Page and admin access to it.
- A Meta app with the Messenger product.
- The Enterprise Admin role in B6AI.
Set up the Page & Meta app
- Create or choose the Facebook Page your bot will answer for.
- At developers.facebook.com, create or select an app and add the Messenger product.
- Under Messenger settings, add/select your Page and generate a Page access token.
- Complete App Review for pages_messaging so the bot can serve all users (not just app testers).
Get your Facebook Page messaging credentials
These are the values you will paste into B6AI. Copy each one carefully.
- From Messenger settings, generate and copy the Page access token.
- Copy the Page ID (Page → About, or from the Meta app).
- From your Meta app’s Settings → Basic, copy the App Secret (B6AI uses it to verify that inbound events really came from Meta).
Page ID: 1044xxxxxxxx
Page access token: EAAG…
App Secret: c1a2b3…Required permissions
Grant exactly these permissions so B6AI can send and receive messages on Facebook.
| Scope / permission | What it allows | Why B6AI needs it |
|---|---|---|
| pages_messaging | Send and receive Page messages | Core: reply to Messenger conversations |
| pages_manage_metadata | Subscribe to Page webhooks | Receive inbound message events |
| pages_read_engagement | Read Page conversations and profile | Attribute and manage conversations |
Configure the webhook
Incoming messages reach B6AI through a webhook. In most cases B6AI registers this for you when you connect; if Facebook requires manual setup, use the values B6AI shows during connection.
- Subscribe the Page to the messages and messaging_postbacks webhook fields.
- Set the Callback URL and Verify Token to the values B6AI shows during channel configuration.
- B6AI completes the verification handshake automatically.
Connect Facebook in B6AI
Channels are configured per bot. In B6AI, open Bots and choose the bot you want on Facebook, switch to its Channels tab, and click Configure on the Facebook card. Complete the form (every field is explained below), Save, then toggle Enable to turn the channel on.
- In B6AI, open Bots, choose your bot, and go to its Channels tab.
- Click Configure on the Facebook Messenger card.
- Enter the Page ID, the Page access token, and your app’s App Secret.
- Copy the callback URL B6AI shows into the Meta webhook configuration.
- Save, then toggle Enable.
| Field | What it is | Example value |
|---|---|---|
| Page ID | Your Facebook Page id | 1044xxxxxxxx |
| Page access token | Token with the pages_messaging permission | EAAG… |
| App Secret | Your Meta app’s secret, used to verify inbound events | c1a2b3… |
Publish the bot to Facebook
Once the channel is configured and enabled on the bot, publish the bot so customers get answers on Facebook.
- On the bot’s Channels tab, confirm the Facebook channel shows Configured and is Enabled.
- Open the bot in Bot Builder and run it through the test simulator until it passes validation.
- Click Publish. The bot now serves conversations on Facebook.
Verify with a test conversation
Confirm the channel is live end to end before sharing it with customers.
- From a different account, message your Facebook Page.
- Confirm the bot replies.
- Check the conversation appears in the Chats inbox and test a handoff.
Messaging rules & behavior
Every channel has its own rules about when and how businesses may message customers. Understanding these prevents blocked or undelivered messages.
- A 24-hour standard messaging window applies for responding to user messages.
- Outside the window, only specific message tags, or the human-agent handoff window, allow you to send.
- App Review with advanced access to pages_messaging is required to serve all users.
- Users must message the Page first; you can’t initiate cold.
Troubleshooting
If messages are not delivered or the bot does not reply, match the symptom below to its cause and fix.
| Symptom / error | Likely cause | How to fix it |
|---|---|---|
| No inbound messages | The Page isn’t subscribed to the app | Subscribe the Page to the app’s webhook fields |
| (#200) permission error | Missing pages_messaging or not approved | Complete App Review and grant the permission |
| Token expired | A short-lived token was used | Use a long-lived or System User Page token |
| Can’t message user | Outside the 24-hour window without a tag | Use an allowed message tag or reply within the window |
Limitations
Keep these constraints in mind when designing conversations for Facebook.
- The 24-hour window plus message tags govern proactive sends.
- App Review is required for public use.
- One Page per channel connection.
Security & compliance
- Grant only the scopes and permissions listed above, never request more “just in case”.
- Rotate your Facebook Page messaging credentials on a regular schedule, and immediately if you suspect exposure.
- Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
- Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
- Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
- Disconnect the integration the moment a credential leaks; then rotate it in Facebook before reconnecting.
Recommendations
- Test against a sandbox or non-production Facebook account before connecting live data.
- Document which bots and flows depend on this integration so changes are predictable.
- Set a recurring reminder to review scopes and rotate credentials.
- Enable only the capabilities you actually use today; you can widen scopes later.