B6AIDocs

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.

8 min read

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 will need
Administrator access to your Facebook account or app, and a B6AI user who can edit bots. Channels are configured per bot on the bot’s Channels tab, so pick the bot you want to serve on Facebook before you start.

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:

  1. Answer Messenger conversations with your bot.
  2. Send quick replies, buttons and carousels.
  3. Hand off to a human agent when needed.
  4. Use message tags for the limited set of allowed proactive notifications.
  5. 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.

  1. A Facebook Page and admin access to it.
  2. A Meta app with the Messenger product.
  3. The Enterprise Admin role in B6AI.

Set up the Page & Meta app

  1. Create or choose the Facebook Page your bot will answer for.
  2. At developers.facebook.com, create or select an app and add the Messenger product.
  3. Under Messenger settings, add/select your Page and generate a Page access token.
  4. 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.

  1. From Messenger settings, generate and copy the Page access token.
  2. Copy the Page ID (Page → About, or from the Meta app).
  3. From your Meta app’s Settings → Basic, copy the App Secret (B6AI uses it to verify that inbound events really came from Meta).
text
Page ID:            1044xxxxxxxx
Page access token:  EAAG…
App Secret:         c1a2b3…
Keep secrets safe
Access tokens and app secrets are sensitive. Store them only in the B6AI channel settings, which encrypts them at rest.

Required permissions

Grant exactly these permissions so B6AI can send and receive messages on Facebook.

Scope / permissionWhat it allowsWhy B6AI needs it
pages_messagingSend and receive Page messagesCore: reply to Messenger conversations
pages_manage_metadataSubscribe to Page webhooksReceive inbound message events
pages_read_engagementRead Page conversations and profileAttribute 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.

  1. Subscribe the Page to the messages and messaging_postbacks webhook fields.
  2. Set the Callback URL and Verify Token to the values B6AI shows during channel configuration.
  3. 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.

  1. In B6AI, open Bots, choose your bot, and go to its Channels tab.
  2. Click Configure on the Facebook Messenger card.
  3. Enter the Page ID, the Page access token, and your app’s App Secret.
  4. Copy the callback URL B6AI shows into the Meta webhook configuration.
  5. Save, then toggle Enable.
FieldWhat it isExample value
Page IDYour Facebook Page id1044xxxxxxxx
Page access tokenToken with the pages_messaging permissionEAAG…
App SecretYour Meta app’s secret, used to verify inbound eventsc1a2b3…

Publish the bot to Facebook

Once the channel is configured and enabled on the bot, publish the bot so customers get answers on Facebook.

  1. On the bot’s Channels tab, confirm the Facebook channel shows Configured and is Enabled.
  2. Open the bot in Bot Builder and run it through the test simulator until it passes validation.
  3. 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.

  1. From a different account, message your Facebook Page.
  2. Confirm the bot replies.
  3. Check the conversation appears in the Chats inbox and test a handoff.
Live
When your test message gets a bot reply and the conversation appears under Chats in B6AI, Facebook is fully connected.

Messaging rules & behavior

Every channel has its own rules about when and how businesses may message customers. Understanding these prevents blocked or undelivered messages.

  1. A 24-hour standard messaging window applies for responding to user messages.
  2. Outside the window, only specific message tags, or the human-agent handoff window, allow you to send.
  3. App Review with advanced access to pages_messaging is required to serve all users.
  4. 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 / errorLikely causeHow to fix it
No inbound messagesThe Page isn’t subscribed to the appSubscribe the Page to the app’s webhook fields
(#200) permission errorMissing pages_messaging or not approvedComplete App Review and grant the permission
Token expiredA short-lived token was usedUse a long-lived or System User Page token
Can’t message userOutside the 24-hour window without a tagUse an allowed message tag or reply within the window

Limitations

Keep these constraints in mind when designing conversations for Facebook.

  1. The 24-hour window plus message tags govern proactive sends.
  2. App Review is required for public use.
  3. One Page per channel connection.
Rate & volume limits
Messenger enforces per-app and per-recipient rate limits; sends outside the window require approved tags.

Security & compliance

  1. Grant only the scopes and permissions listed above, never request more “just in case”.
  2. Rotate your Facebook Page messaging credentials on a regular schedule, and immediately if you suspect exposure.
  3. Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
  4. Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
  5. Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
  6. Disconnect the integration the moment a credential leaks; then rotate it in Facebook before reconnecting.

Recommendations

  1. Test against a sandbox or non-production Facebook account before connecting live data.
  2. Document which bots and flows depend on this integration so changes are predictable.
  3. Set a recurring reminder to review scopes and rotate credentials.
  4. Enable only the capabilities you actually use today; you can widen scopes later.
Was this page helpful?