You can use the Call-To-Action (CTA) button type audio_call in the Messenger API. This button type provides a new entry point for users to initiate calls with businesses by clicking the audio_call button directly from a button in the generic and button templates.
This audio_call CTA button offers enhanced customization compared to the existing call prompt template.
You can send this audio_call button using a generic template.
| Property | Description |
|---|---|
| This is the Page ID connected to the app |
| The Page-scoped ID of the consumer to whom the message template is requested |
| The body of the message |
| The XMA attachment as part of the message |
| The type of the attachment; in this case |
| The payload of the attachment |
| The type of the template, in this case |
| The elements that will be used in the template |
| The buttons CTA that will be used in the template. type: the type of the button CTA, in this case “audio_call” title (required): the title of the button CTA expires_in_days (default 7): how long the button is clickable. The default value is 7 and cannot exceed 7 days. |
POST /<PAGE_ID>/messages
{
"recipient": {
"id": "<PSID>"
},
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Contact Support!",
"buttons": [
{
"type": "audio_call",
"title": "Call Now",
"expires_in_days": 5
}
]
}
]
}
}
}
}| Property | Description |
|---|---|
| The Page-scoped ID of the user to whom the opt-in is requested |
| The external-facing message ID (mid) of the message sent |
{
"recipient": {
"id": <PSID>,
"message_id": <mid>,
}
}The following errors can happen:
expires_in_days is set above 7For more details on these errors, see the Messenger Platform error codes reference.
You can send this audio_call button using a button template.
| Property | Description |
|---|---|
| This is the Page ID connected to the app |
| The Page-scoped ID of the consumer to whom the message template is requested |
| The body of the message |
| The XMA attachment as part of the message |
| The type of the attachment; in this case |
| The payload of the attachment |
| The type of the template, in this case |
| The elements that will be used in the template |
| The buttons CTA that will be used in the template. type: the type of the button CTA, in this case "audio_call" title (required): the title of the button CTA expires_in_days (default 7): how long the button is clickable. The default value is 7 and cannot exceed 7 days. |
POST /<PAGE_ID>/messages
{
"recipient": {
"id": "<PSID>"
},
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "Contact Support!",
"buttons": [
{
"type": "audio_call",
"title": "Call Now",
"expires_in_days": 5
}
]
}
}
}
}| Property | Description |
|---|---|
| The Page-scoped ID of the user to whom the opt-in is requested |
| The external-facing message ID (mid) of the message sent |
The following errors can happen:
expires_in_days is set above 7For more details on these errors, see the Messenger Platform error codes reference.