How it flows
- The app runs Meta’s Embedded Signup and receives
code,wabaIdandphoneNumberId. POST /api/v1/channels/whatsapp/embedded-signup/completeexchanges the code, points the WABA’s webhooks at your relay address (override_callback_uri) and registers the number.- Meta posts to
https://api.allternit.com/channels/in/<key>. The cloud answers the verify handshake, checksX-Hub-Signature-256, then relays to your runtime (a cloud computer is woken if asleep). - The bot’s reply goes out through
POST /api/v1/channels/whatsapp/send. Each message starts with the speaking bot’s name in bold, because one number has one display name.
relaySecret, which it stores as the account’s appSecret.
Complete signup
201:
{ "mode": "business", "appSecret": "<relaySecret>", "phoneNumberId": "222", "cloudToken": "<allternit_ API token, compute scope>" }.
Send and the 24-hour window
409 {"error":"outside_24h_window"}. Success returns { "messageId": "wamid...", "windowOpen": true }.
Turning it on
SetMETA_APP_ID, META_APP_SECRET, META_ES_CONFIG_ID and META_SYSTEM_TOKEN on cloud-api, plus ALLTERNIT_CREDENTIALS_KEY. While they are unset, every route above returns 503 {"error":"whatsapp_not_configured"}. Apply cloud migration 028_whatsapp_embedded_signup.sql by hand first.
Graph API version: v25.0.