Skip to main content
Back to messaging or digital channels Connect a Facebook Page to your agent so people reach it through Messenger. You prepare one Meta app and one Page, hand Artemis four values from them, then register a signed webhook that Meta verifies before it sends anything. The setup requires:
  1. Meta setup: create a business app, connect the Page, and collect the Page ID, Page Access Token, and App Secret.
  2. Artemis channel configuration using those values plus a Verify Token you invent, then copy the generated webhook URL.
  3. Webhook configuration in Meta: register the callback URL, complete Meta’s challenge, and subscribe the Page to the message events.
After the configuration is complete, Meta posts signed Page events to Artemis, which matches the Page ID in the payload to this connection and hands the message to the deployed agent. Important considerations
  • Every value must come from one app and one Page: The Page ID, Page Access Token, App Secret, Verify Token, and webhook subscription all have to belong to the same Meta app and Page setup. Mixing values from two apps produces failures that look unrelated to each other.
  • One Page routes to one connection: Reusing a Page means deactivating the existing connection first, or the second one has nothing to route to.
  • Verification and subscription are separate steps: Meta verifies the callback URL whether or not you subscribe to anything, so a verified webhook with no subscription looks correct on screen and delivers nothing.
  • Development mode blocks the public: Until Meta approves the app and you switch it to Live, Page tokens reach only accounts holding an app or Page role. A successful test with a role-holding account proves nothing about public access.
The Meta work spans three screens in the App Dashboard at Meta for Developers.

Prerequisites

  • A Meta developer account, and a Facebook Page that customers will message.
  • Enough access on the Page to perform the messaging and moderate tasks. Meta requires this of whoever generates the Page Access Token, so an editor or viewer role fails even when the app side looks correct.
  • An HTTPS-reachable Artemis runtime, since Meta calls the callback URL during verification.
  • Artemis project access with permission to open Deployments -> Channels, and a deployed agent in the environment you intend to bind.

How Artemis routes Messenger events

Meta sends every Page event to one generic URL, so Artemis identifies the connection from the payload rather than the path. It reads the Page ID out of the signed event and matches it to a connection.

Meta setup

Complete all of this in Meta before you open Artemis. Meta covers the same ground in its Messenger Platform quick start.
1

Create or open a business app

  1. Sign in to Meta for Developers and open My Apps.
  2. Create an app, or open the one that will own this connection.
  3. When Meta asks what the app does, choose the business messaging use case, or choose Other and then Business as the app type if Meta shows you that older flow.
Only a business app exposes the Messenger product, so choosing the wrong type means creating a second app rather than converting the first.Use separate apps or Pages for development and production, because app mode and Page subscriptions belong to the app.
2

Add the Messenger product

  1. On the App Dashboard, find Messenger in the products list.
  2. Select Set up. The left menu then carries a Messenger section holding the settings screen you’ll return to several times.
Meta renames this screen between app types, so you may see Messenger API Settings, or Messenger followed by Settings. Whichever label appears, the screen you want holds three areas together: a Page connection, a token generation panel, and webhook controls. If the screen you’re looking at has only one of those, you’re on the wrong one.
3

Connect the Facebook Page

  1. In the token generation area, add or select the Page customers will message.
  2. Authorize the app on that Page when Meta asks.
Your account needs enough access on both sides. Meta requires that whoever generates the Page token can perform the messaging and moderate tasks on the Page, so an editor or viewer role fails here even when everything on the app side looks right. Sort the Page role out before you continue, because the failure it produces later looks like a token problem.
4

Generate and copy the Page Access Token

  1. Select the Page in the Page dropdown. A token appears in the Page Access Token field.
  2. Select the field to copy the token.
Two behaviors here catch people out. Meta doesn’t store the token in this screen, so you can’t come back and read it; you generate a fresh one instead. And each time you select the Page from the dropdown, Meta generates a new token, while every token it generated earlier keeps working. That means an accidental extra generation doesn’t break anything, but it does leave live credentials you didn’t intend to create, so treat each generation as deliberate.This token is Page-scoped rather than user-scoped. A user token, or a token generated for a different Page, authenticates successfully and then fails to deliver replies.
5

Find the numeric Page ID

Artemis routes on the Page’s numeric ID, which is a different value from everything else Meta shows you about the Page.
  1. Open the Page in Facebook and look under its About information, where Facebook lists the Page ID among the page’s transparency details.
  2. Or open the Page’s settings in Meta Business Suite, which also shows it.
Don’t substitute the Meta App ID, the Business ID, the Page username from the Page’s web address, or the page-scoped user ID. That last one, the PSID, appears in every inbound event and identifies the customer, not the Page: Meta issues each person a different PSID for each Page they message.
6

Copy the App Secret

The App Secret sits outside the Messenger section, so the left menu is the only route to it.
  1. Go to App settings -> Basic.
  2. Select Show beside App secret.
  3. Re-enter your Facebook password when Meta asks, then copy the value.
Artemis uses this secret to verify that an inbound event genuinely came from Meta. Take it from the same app that owns the Messenger product, since an App Secret from a neighboring app produces a signature failure on every single message.
7

Choose a Verify Token

Invent a high-entropy secret string. Meta doesn’t issue this one, so you create it and enter the same value twice: once in Artemis, once in the Meta webhook configuration.Artemis lets you save a connection without it, but Meta’s verification can’t succeed until a matching non-empty value exists in both places.
8

Add testers and plan for Live mode

While the app stays in development mode, Page tokens reach only Facebook accounts holding an administrator, developer, or tester role on the app.
  1. Grant those roles from the Roles tab of your app settings, which Meta describes under standard access.
  2. Have each person accept the invitation before you test with them.
  3. Before ordinary customers can message the Page, submit the app for review on the messaging permissions, complete business verification, and switch the app to Live mode using the control at the top of the App Dashboard.
A successful test with a role-holding account proves nothing about public access. Plan to repeat it with an account holding no role once the app goes Live.

Artemis channel configuration

Create the connection before you configure the callback in Meta. Meta sends its verification request the moment you save the webhook, and Artemis can only answer that challenge from a stored Verify Token.
  1. Open Artemis and select the project.
  2. Go to Deployments -> Channels -> Messenger -> + New. The New Messenger Connection dialog opens.
  3. Configure the following fields:
  4. Select Create.
  5. Open the connection and copy the Webhook URL from the Overview tab. You need it for the next section.

Webhook configuration in Meta

Registration has two halves, and completing only the first is the most common way a setup fails silently. Meta verifies the URL whether or not you subscribe to anything.
1

Open the webhook controls

  1. Return to the Messenger settings screen in the same Meta app.
  2. Find the webhooks area and add a callback for the Page object.
Configure the URL here rather than under another Meta product. A callback registered under a different product verifies successfully and delivers nothing to this connection, which is a slow failure to trace because both screens report success.
2

Enter the callback URL and Verify Token

  1. Paste the Artemis Webhook URL exactly as shown.
  2. Enter the same Verify Token you saved in Artemis.
Don’t append a Page ID, a connection ID, a query string, or a trailing segment. Artemis takes the Page ID from the signed payload, so anything added to the path breaks the route rather than refining it.
3

Complete the verification challenge

Save the callback. Meta immediately calls the URL with a subscribe challenge and expects your Verify Token echoed back.Artemis answers only when the token matches an active connection, so a failure here points at the token, the connection status, or public reachability over HTTPS rather than at the URL itself.
4

Subscribe to messages and messaging_postbacks

  1. In the webhook fields list, select Manage.
  2. Subscribe the Page webhook to messages and messaging_postbacks.
The messages field carries text, attachments, and quick-reply payloads, so it’s required even for an agent that only handles text. Subscribe messaging_postbacks as well if your agent sends buttons, since a button tap arrives as a separate event type carrying the authored payload rather than as a message.
5

Subscribe the Page and save

  1. Confirm this app and webhook list the intended Page as subscribed.
  2. Save the app changes.
If Meta asks for permissions review or Page task access for your current app mode, complete that before you test with anyone outside your app roles.

Validation checklist

Verify the connection

Artemis doesn’t synthesize Meta events, so a real Messenger conversation is the only end-to-end proof.
  1. While the app sits in development mode, use a Facebook account holding an app or Page role. Open the connected Page in Messenger and send a short message you can search for later. Confirm Meta reports a successful webhook delivery and that Artemis opens one session.
  2. Check that a single outbound reply appears in the same conversation. A send failure at this point usually means the token belongs to the wrong Page, the messaging permission is missing, someone revoked the token, or the app mode still restricts delivery.
  3. Trigger a quick reply and a button postback, and confirm each returns to the same session. Artemis normalizes both into action events, so the authored action ID and value still have to exist in the agent.
  4. Send each message type your Page will use. Artemis downloads image, video, audio, and file attachments before the agent processes them. Location, sticker, and fallback attachments arrive as events rather than as files, so an agent that expects a downloadable attachment won’t find one.
  5. Once Meta approves the app and you switch it to Live mode, run the same test from an account with no app or Page role. This is the only check that proves ordinary customers can reach the agent.

Messenger limits

Meta enforces these boundaries on outbound content, and Artemis applies them before it calls the Send API. Design your agent’s responses to fit them.

Secure the connection

Messenger authentication runs in one direction only, which is easy to misread. Meta signs what it sends you; your Verify Token does nothing after setup. Every Messenger POST carries X-Hub-Signature-256. Artemis computes HMAC-SHA256 over the raw request body using your App Secret and rejects a missing or mismatched signature. Any proxy or middleware in front of Artemis has to preserve the exact request bytes, because reformatting the JSON changes the digest even when the content stays identical. Keep the three secrets distinct in your own operational notes. The Verify Token protects only the initial challenge and is a string you invented. The App Secret authenticates inbound traffic. The Page Access Token authorizes outbound sends, and you can rotate it without touching the Page ID, so a token rotation never requires a new connection. Artemis rejects Messenger events older than five minutes as replay protection. Replaying a captured payload during debugging therefore fails by design, and a live message is the only way to retest. Use separate Meta apps or Pages, credentials, callbacks, and connections for development and production.

Manage the channel connection

Opening a connection shows four tabs. The delete control sits beside the connection name.
Connection Summary reports the connection’s state and identity.Setup Instructions shows the Webhook URL to register in Meta and the Facebook Page ID this connection matches events to, each with a copy control. Check the Page ID here first when messages arrive and no session appears.

Troubleshoot connection issues


Meta reference

Use these Meta pages when you need detail beyond what this article covers. Related articles: