A template message starts a conversation any time, even outside the 24-hour window, as long as the template is approved. You pass the template name, language, and the values for its variables.
curl -X POST \
"https://graph.facebook.com/v23.0/PHONE_NUMBER_ID/messages" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "919867800451",
"type": "template",
"template": {
"name": "order_confirmation",
"language": { "code": "en" },
"components": [{
"type": "body",
"parameters": [
{ "type": "text", "text": "Asha" },
{ "type": "text", "text": "ORD-9271" }
]
}]
}
}'The number and order of parameters must match the approved template body. A mismatch returns an error. Create and check templates in the dashboard first.
For how templates work and the three categories, see the templates overview.
Building an integration? If you hit a wall, message us and a developer will help, the only platform in India that answers you live on WhatsApp.
Ask us on WhatsApp