AIFENG DCS · Meta Official Integration

Facebook Page · Instagram Professional Account · reusing app AIFENG_DCS_WA_API · Language: zh-CN | id-ID | en-US

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

  1. A Meta developer account that can log in to developers.facebook.com
  2. The existing Meta app AIFENG_DCS_WA_API (already used by the WhatsApp integration)
  3. A Facebook Page for the company
  4. The company Instagram account switched to a professional account and linked to the Page
  5. The public HTTPS entry app.aifengdcs.com reachable (needed for the webhook callback)
Step 1Open the existing Meta app
What to doLog 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 spotThe 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 doIn the app dashboard click 'Add Product' → find Messenger → Set up. It handles FB Page direct messages.
What the boss does on the spotConfirm the app is in development mode for testing; App Review comes before go-live.
Step 3Add the Instagram product
What to doAdd 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 spotConfirm the company IG account is a professional account and is linked to the FB Page.
Step 4Generate the Page access token
What to doMessenger 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 spotThe 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 doIn 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 spotConfirm the IG account is the official company account, not a personal one.
Step 6Configure the webhook callback
What to doApp 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 spotThe 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 doSubscribe 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 spotEach subscribed field triggers a verification request from Meta; a green check means success.
Step 8Request advanced access for go-live
What to doDevelopment 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 spotThe boss provides the company documents; during review, real customer messages keep flowing through existing channels.
Status Check → Webhook →
⚠ Real Meta connection (tokens, webhook go-live, permission review) is Human-Gate PENDING and runs only after the boss approves each step.