WhatsApp Cloud Adapter Starter Guide
Last updated 2026-02-12
Reference implementation:
rooaak-whatsapp-cloud-adapter-starter
Required env
ROOAAK_API_KEYROOAAK_WEBHOOK_SECRETROOAAK_AGENT_IDWHATSAPP_VERIFY_TOKENWHATSAPP_APP_SECRETWHATSAPP_ACCESS_TOKEN
Meta dashboard setup
- Open developers.facebook.com/apps and select app.
- Add/select WhatsApp product.
- Go to WhatsApp -> Configuration -> Webhooks.
- Configure:
- Callback URL:
https://<your-host>/webhooks/whatsapp - Verify token: exactly
WHATSAPP_VERIFY_TOKEN
- Callback URL:
- Click Verify and Save.
- Subscribe
messagesfield.
Credential sources
WHATSAPP_VERIFY_TOKEN:- self-generated secret string, example:
openssl rand -hex 24
WHATSAPP_APP_SECRET:- App settings -> Basic -> App Secret.
WHATSAPP_ACCESS_TOKEN:- WhatsApp API Setup page (use long-lived/system-user token in production).
Rooaak webhook registration
curl -X POST https://www.rooaak.com/api/v1/webhooks \
-H "Authorization: Bearer $ROOAAK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://<your-host>/webhooks/rooaak",
"events": ["message.responded"]
}'Persist returned secret as ROOAAK_WEBHOOK_SECRET.
Session mapping
sessionId:whatsapp:<phone_number_id>:<wa_id>metadata.channel.type:whatsapp_cloud- include provider IDs in
metadata.channel.*
Smoke test
- Send WhatsApp message from tester number to configured sender/test number.
- Verify adapter forwards inbound message to Rooaak.
- Verify Rooaak response is delivered back to WhatsApp chat.
Failure checks
- Verify callback fails:
WHATSAPP_VERIFY_TOKENmismatch between Meta and runtime.
- Inbound requests rejected:
WHATSAPP_APP_SECRETmismatch causes signature verification failure.
- Outbound message errors:
- invalid/expired
WHATSAPP_ACCESS_TOKEN.
- invalid/expired