WhatsApp message templates
Send approved WhatsApp templates from the customer's own WhatsApp Business Account.
WhatsApp messages go out through a WhatsApp Business Account the customer owns and pays for in Meta Business Manager. PushFyre stores the access token and calls Meta's Cloud API with it. Meta invoices that account. PushFyre does not put these messages on its own Meta bill.
Connect the account
- In Meta Business Manager, add a payment method to the WhatsApp Business Account and create a permanent access token for a system user that can send messages.
- In the portal open Settings → WhatsApp and save the WhatsApp Business Account ID, the phone number ID, and the access token.
- Create and approve the template in WhatsApp Manager, then choose Sync from Meta or type the template name and language.
- In the Meta app, set the callback URL shown on that settings page to
{your API}/api/v1/webhooks/whatsappand paste the verify token shown next to it. Subscribe to message status.
WHATSAPP_GRAPH_VERSION (for example v21.0) and WHATSAPP_WEBHOOK_VERIFY_TOKEN before a send or a webhook check will succeed. The token is not a fallback; if either value is missing, that call fails.Collect the phone number
A campaign reaches a device only when that device subscribed on Android or iOS and the app called setWhatsAppPhone after the person agreed. A push token alone is not enough. The host app must show the explanation and collect the agreement. The SDK does not show its own dialog.
- Android:
PushFyre.setWhatsAppPhone(context, "+14155552671"). Withdraw withPushFyre.clearWhatsAppPhone(context). - iOS:
PushFyre.setWhatsAppPhone("+14155552671"). Withdraw withPushFyre.clearWhatsAppPhone(). - The number is international, with a country code. It is sent again on later registrations, including token refresh.
- Setup steps are in Android and iOS.
Send from the API
Use the same send endpoint. Set channels to ["whatsapp"] and put the template on payload.whatsapp. title and message are still required on the payload; the text the person sees is the approved template, with variables filled in order.
curl -X POST https://push.example.com/api/v1/push/send \
-H "x-app-id: app_49e692ad" \
-H "x-api-key: <your-api-key>" \
-H "x-tenant-id: <your-tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"campaignName": "Order shipped",
"type": "simple",
"channels": ["whatsapp"],
"payload": {
"title": "Order shipped",
"message": "Your order is on the way.",
"whatsapp": {
"templateName": "order_shipped",
"language": "en",
"variables": ["1042", "Friday"]
}
}
}'A test to a typed number, which does not require an opt-in row, is POST /api/v1/whatsapp/test with a signed-in session. Campaigns from Messages → WhatsApp use only opted-in numbers.
Undelivered pushes
In Settings → WhatsApp, turn on Send on WhatsApp when a push is not confirmed. The switch stays off until the organization is on an active plan that includes WhatsApp and the WhatsApp account on this page is saved. Choose the approved template first.
When a push to a device is not confirmed by the push network, that device is sent the template immediately. The push is not retried for that device. The person must already have opted in with setWhatsAppPhone. A confirmed push is not sent again on WhatsApp.
Status
Meta reports sent, delivered, read, and failed to the webhook. Read is stored as opened on the campaign. A/B testing does not cover WhatsApp.
Plan
WhatsApp is included on every plan. If a plan does not include it, the portal keeps the page open and asks you to choose a plan that does.