MARKETING or UTILITY. This page demonstrates creating and sending a call permission request template with the MARKETING category. See Call permission request templates for a utility example.
MARKETING or UTILITY can include a call permission request componentcurl -X POST \
'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "<TEMPLATE_NAME>",
"language": "<TEMPLATE_LANGUAGE>",
"category": "<CATEGORY>",
"parameter_format": "named",
"components": [
{
"type": "body",
"text": "<BODY_TEXT>",
"example": {
"body_text_named_params": [
{
"param_name": "<PARAM_NAME>",
"example": "<EXAMPLE_PARAM_VALUE>"
}
]
}
},
{
"type": "call_permission_request"
}
]
}'
| Placeholder | Description | Example Value |
|---|---|---|
<ACCESS_TOKEN>String | Required. | EAAA... |
<API_VERSION>String | Optional. Graph API version. | v25.0 |
<BODY_TEXT>String | Required. Body text string. Supports named parameters in {{parameter_name}} format.Maximum 1024 characters. | Hi {{first_name}}, as a Lucky Shrub VIP, get a first look at our rare new succulents before anyone else. Can we give you a quick call? |
<CATEGORY>Enum | Required. Template category. Must be MARKETING or UTILITY. | MARKETING |
<EXAMPLE_PARAM_VALUE>String | Required if body text uses named parameters. Example value for the named parameter. | Pablo |
<PARAM_NAME>String | Required if body text uses named parameters. Name of the parameter, matching the placeholder in the body text. | first_name |
<TEMPLATE_LANGUAGE>Enum | Required. Template language and locale code. | en_US |
<TEMPLATE_NAME>String | Required. Template name. Maximum 512 characters. | vip_early_access_call |
<WHATSAPP_BUSINESS_ACCOUNT_ID>String | Required. WhatsApp Business account ID. | 106540352242922 |
curl -X POST \
'https://graph.facebook.com/v23.0/106540352242922/message_templates' \
-H 'Authorization: Bearer EAAJB...' \
-H 'Content-Type: application/json' \
-d '{
"name": "vip_early_access_call",
"language": "en_US",
"category": "MARKETING",
"parameter_format": "named",
"components": [
{
"type": "body",
"text": "Hi {{first_name}}, as a Lucky Shrub VIP, get a first look at our rare new succulents before anyone else. Can we give you a quick call?",
"example": {
"body_text_named_params": [
{
"param_name": "first_name",
"example": "Pablo"
}
]
}
},
{
"type": "call_permission_request"
}
]
}'
{ "id": "546151681022936", "status": "PENDING", "category": "MARKETING" }
curl -X POST \
'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<WHATSAPP_USER_PHONE_NUMBER>",
"type": "template",
"template": {
"name": "<TEMPLATE_NAME>",
"language": {
"policy": "deterministic",
"code": "<TEMPLATE_LANGUAGE_CODE>"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"parameter_name": "<PARAM_NAME>",
"text": "<PARAM_VALUE>"
}
]
}
]
}
}'
| Placeholder | Description | Example Value |
|---|---|---|
<ACCESS_TOKEN>String | Required. | EAAA... |
<API_VERSION>String | Optional. Graph API version. | v25.0 |
<PARAM_NAME>String | Required if the template body uses named parameters. Name of the parameter to replace in the template body. | first_name |
<PARAM_VALUE>String | Required if the template body uses named parameters. Value to substitute for the named parameter. | Pablo |
<TEMPLATE_LANGUAGE_CODE>Enum | Required. Template language and locale code. | en_US |
<TEMPLATE_NAME>String | Required. Name of the template to send. | vip_early_access_call |
<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>String | Required. WhatsApp business phone number ID. | 106540352242922 |
<WHATSAPP_USER_PHONE_NUMBER>String | Required. WhatsApp user phone number. | +16505551234 |
curl -X POST \
'https://graph.facebook.com/v23.0/106540352242922/messages' \
-H 'Authorization: Bearer EAAJB...' \
-H 'Content-Type: application/json' \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+15551234567",
"type": "template",
"template": {
"name": "vip_early_access_call",
"language": {
"policy": "deterministic",
"code": "en_US"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"parameter_name": "first_name",
"text": "Pablo"
}
]
}
]
}
}'
{ "messaging_product": "whatsapp", "contacts": [ { "input": "+15551234567", "wa_id": "15551234567" } ], "messages": [ { "id": "wamid.HBgLMTMyMzI4NjU2NzgVAgARGBJBQzRBRDBEMDEwQzVBM0M0QkIA", "message_status": "accepted" } ] }