Facebook Messenger in a project: Page messages through your own Meta app

SENSEVER

The official Sensever channel: guides and API documentation for Chat, Requests, Flow, Studio, bots and messaging channels.

6 dk okuma

Facebook Messenger in a project: Page messages through your own Meta app

Messages sent to your Facebook Page arrive in the project's requests, and replies go back to the customer in Facebook Messenger. The connection runs through your own Meta app — the same app you use for WhatsApp or Instagram works too.

What you need

  • A Facebook Page, and you are its admin (full control).

  • A developer account at developers.facebook.com and a Meta app where you are an admin.

  • A link to your website's privacy policy — Meta won't publish the app without it.

  • Owner or admin rights in the Sensever project.

Step 1. A Meta app with Facebook Messenger

  1. Open developers.facebook.com/apps.

  2. If you don't have an app, click "Create app" and choose the "Engage with customers on Messenger from Meta" use case.

  3. If you already have an app (for example, for WhatsApp or Instagram), open it → Use cases → Add use case → the same use case.

Step 2. Page token and App secret

  1. In that use case, open "Messenger API Setup".

  2. In the "Generate access tokens" section, click "Connect", choose your Page and allow access.

  3. Next to the Page, click "Generate" and copy the token — it starts with EAA.

  4. Open App settings → Basic and copy the App secret (click "Show"). This is the same secret WhatsApp uses; it is not the Instagram app secret.

A Page token generated this way usually has no expiry date; it stops working if you change your Facebook password, lose admin rights on the Page or remove the app from the Page. If that happens, the "Sensever Channels" bot tells you.

Step 3. Connect the Page in Sensever

  1. Projects → the project → "Channels" → the "Messaging channels" block.

  2. On the grey Facebook Messenger tile, click "Connect".

  3. Paste the Page access token and the App secret, and choose a department or leave "Shared queue".

  4. Click "Connect". Sensever checks that the token belongs to a Page and that your app may read the Page's messages. You'll see "Page accepted. Now paste the Callback URL and Verify token into your Meta app", and the tile status reads "Waiting for the first request from Meta". This is normal.

Sensever subscribes the Page to your app on its own, so you don't need to do that in the dashboard.

Step 4. The webhook in the Meta app

  1. In Sensever, click the gear on the Facebook Messenger tile. In the "Webhook details for the Meta dashboard" block, copy the Callback URL and Verify token with the "Copy" buttons.

  2. In the Meta app: the use case from step 1 → "Messenger API Setup" → "Configure webhooks".

  3. Paste the Callback URL and Verify token and click "Verify and save".

  4. In the list of webhook fields, turn on messages, as well as messaging_postbacks, message_reactions, message_reads, message_echoes and messaging_referrals — so that button taps, reactions, read receipts, replies sent from Meta Business Suite and arrivals from your website widget come through.

As soon as Meta sends the first request, the tile status changes to "Connected". If that hasn't happened within an hour, the "Sensever Channels" bot reminds you that the webhook isn't saved.

Step 5. Publish the app

While the app is in development mode, Meta delivers messages only from people who have a role in the app — your customers won't reach you.

  1. In the Meta app: App settings → Basic — enter the Privacy policy URL (a page on your website) and save.

  2. Click "Publish" (switch the app to Live mode).

Step 6. Check it

Message your Page from a personal Facebook account that has no role in the app or on the Page. The message appears in the project's requests with the customer's name, and a Facebook Messenger button appears in the widget on your site (if "Show in widget" is checked).

What is passed

  • From the customer: text, photos, videos, voice messages, files, reactions, read receipts, button taps. If the customer replies to a specific message, the request shows it as a reply.

  • To the customer: text (a long reply is split into parts), reactions, read receipts, "typing…" and files; a file Facebook Messenger doesn't accept is sent as a link that is valid for 48 hours. Facebook Messenger doesn't let you edit or delete a sent reply.

  • Replies sent from Meta Business Suite or the Page inbox stay there: Sensever doesn't copy them into the request.

Limitations

  • 24 hours. You can reply only within 24 hours of the customer's last message. After that, the message shows "Not sent: in Facebook Messenger you can reply only within 24 hours of the customer's message".

  • Up to 7 days with the human_agent permission. Meta lets a human agent reply up to 7 days after the customer's message if the app has been approved for the human_agent permission (App Review → Permissions and Features → human_agent). Once it is approved, Sensever sends late replies with the required tag on its own.

  • One Page, one project. The same Page can't be connected to a second Sensever project.

  • Not in every country. Meta may limit Facebook Messenger features for businesses in some regions; Sensever doesn't change that.

People without a role in your app

Meta gives a new app Standard Access: it is enough to send and receive messages, but Meta may hold back messages from people who have no role in the app. Sensever watches for this: if the Page's conversations move but Meta doesn't send the messages to Sensever, the "Sensever Channels" bot says so. Then request Advanced Access for the pages_messaging permission in App Review (in the Meta app: the use case → "Complete App Review" → "Request Permission"), or write to Sensever support.

Possible errors

Message

What to do

The messenger didn't accept the token

The token wasn't copied in full, was generated for a different Page or was revoked. Generate a new one (step 2) and paste it via the gear

The app secret doesn't look real

Copy the App secret (32 letters and digits) from App settings → Basic

Meta signs requests with a different secret

The secret was reset or the Instagram app secret was pasted. Click the gear, then × next to the secret, and paste the current App secret

This is a personal token, not a Page token

A user token was pasted. In "Messenger API Setup" → "Generate access tokens", click "Generate" next to your Page and paste that token

Meta does not give your app access to the Page's messages

The app lacks the pages_messaging permission or the Page isn't connected to it. Connect the Page in "Generate access tokens" again; if Meta asks for it, request Advanced Access in App Review

The "Waiting for the first request from Meta" status doesn't change

The webhook isn't saved (step 4) or the Callback URL wasn't copied in full

Customer messages don't arrive, but your test messages do

The app isn't published (step 5)

Facebook Messenger didn't deliver the message

The customer is unavailable, blocked the Page or deleted the conversation

General channel settings — department, showing in the widget, button order, notifications — are described in the article "Project messaging channels: messengers in Requests".

Yorumlar

Yazarlar