Getting Started
Message your local bot from your own phone, using a free Meta test number and a tunnel.
Meta gives every new app a test number that can message up to five recipients. That is enough to develop against the real API. Your machine needs to be reachable from the internet, which is what ngrok is for.
You may not need this
For everyday development the mock interface is faster and has no approval step. Come here when you are working on webhook handling, media delivery, templates or Flows, which the mock cannot exercise.META_APP_ID=your_app_id
META_APP_SECRET=your_app_secret
META_API_VERSION=v22.0The app secret is what verifies that incoming webhooks really came from Meta.WHATSAPP_CLOUD_NUMBER_ID=your_phone_number_id
WHATSAPP_API_TOKEN=your_access_tokenA 24 hour token is fine for an afternoon. For anything longer, create a system user token instead.Meta needs a public HTTPS URL. Create a free static domain in the ngrok dashboard under Domains, then:
ngrok config add-authtoken YOUR_AUTHTOKEN
ngrok http 8000 --domain your-domain.ngrok-free.appLeave that running. Port 8000 is what the API container publishes.
WHATSAPP_VERIFY_TOKEN=some_random_string
MOCK_WHATSAPP=FalseRestart the API so it picks up the changes.| Field | Value |
|---|---|
| Callback URL | https://your-domain.ngrok-free.app/webhooks |
| Verify token | Exactly your WHATSAPP_VERIFY_TOKEN |
/webhooks suffix is easy to forget and is required.Message the test number from your phone. You should get a reply.
| What you see | What it means |
|---|---|
403 during verification | The verify token in the dashboard does not match your .env. Restarting the API after editing it is a common miss. |
400 during verification | Meta did not send the expected parameters. Usually a malformed callback URL. |
403 Invalid signature on messages | META_APP_SECRET is wrong. Every incoming webhook is checked against it. |
| Verification passes, no messages arrive | You did not subscribe to the messages field. |
| Messages arrive but nothing happens | Anything older than ten seconds is dropped on purpose. Breakpoints and slow tunnels trigger this. |
| Only template messages get through | You have not replied to the test template from your phone. |
WhatsApp Flows need more than this
The onboarding and settings screens use WhatsApp Flows, which require a verified business account, an RSA key pair registered with Meta, and the flow IDs in your environment. The test number alone will not get you there. See Environment Variables for the full list.