Setup Guide · 8 Steps to Connect FB + INS
Reuses the existing Meta app AIFENG_DCS_WA_API — no new app needed. Each step states: what to do / what the boss does on the spot.
Prerequisites
- A Meta developer account that can log in to developers.facebook.com
- The existing Meta app AIFENG_DCS_WA_API (already used by the WhatsApp integration)
- A Facebook Page for the company
- The company Instagram account switched to a professional account and linked to the Page
- The public HTTPS entry app.aifengdcs.com reachable (needed for the webhook callback)
Step 1Open the existing Meta app
| What to do | Log in to developers.facebook.com and open the existing app AIFENG_DCS_WA_API (WhatsApp already uses it; FB/INS reuse the same app, no new app needed). |
|---|---|
| What the boss does on the spot | The boss logs into the Meta developer account personally and confirms the app AIFENG_DCS_WA_API is visible. |
Step 2Add the Messenger product
| What to do | In the app dashboard click 'Add Product' → find Messenger → Set up. It handles FB Page direct messages. |
|---|---|
| What the boss does on the spot | Confirm the app is in development mode for testing; App Review comes before go-live. |
Step 3Add the Instagram product
| What to do | Add the Instagram product in the same dashboard. Prerequisite: the FB Page is linked to an Instagram professional account (free switch inside the IG app settings). |
|---|---|
| What the boss does on the spot | Confirm the company IG account is a professional account and is linked to the FB Page. |
Step 4Generate the Page access token
| What to do | Messenger settings → 'Access Tokens' → add/link the FB Page → generate a Page Access Token. The boss stores it only in the server environment variable META_PAGE_TOKEN — never in code, never in chat history. |
|---|---|
| What the boss does on the spot | The boss copies the token personally and pastes it into the server environment config file; tokens never go through web pages or chat boxes. |
Step 5Link the IG professional account
| What to do | In Messenger or Instagram settings, add the linked Instagram professional account to the app and note the IG user ID (server env META_IG_USER_ID). |
|---|---|
| What the boss does on the spot | Confirm the IG account is the official company account, not a personal one. |
Step 6Configure the webhook callback
| What to do | App settings → Webhooks → choose the Page and Instagram objects → set the callback URL to https://app.aifengdcs.com/api/meta/webhook and a self-defined verify token (server env META_VERIFY_TOKEN, identical on both sides). |
|---|---|
| What the boss does on the spot | The callback URL must be public HTTPS; the verify token is self-defined and lives only on the server. |
Step 7Subscribe to message fields
| What to do | Subscribe the Page object to messages, messaging_postbacks, feed (comments); the Instagram object to messages, comments. Only then are new DMs and comments pushed to /api/meta/webhook. Details on this module's 'Webhook' page. |
|---|---|
| What the boss does on the spot | Each subscribed field triggers a verification request from Meta; a green check means success. |
Step 8Request advanced access for go-live
| What to do | Development mode only receives messages from tester accounts. Go-live requires App Review for pages_messaging, instagram_manage_messages, pages_manage_metadata advanced access. Prepare business verification documents. |
|---|---|
| What the boss does on the spot | The boss provides the company documents; during review, real customer messages keep flowing through existing channels. |
⚠ Real Meta connection (tokens, webhook go-live, permission review) is Human-Gate PENDING and runs only after the boss approves each step.