logo
enes

Call button (voice call)

Last update: 6 hours ago by Irais Aguirre

Integration summary

  • Endpoint: POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging
  • Token: messaging token, in the Authorization: Bearer {{wa-msg-api-token}} header (how to generate it)
  • Common fields: from, to (phone number or BSUID) and type (details)
  • type values on this page: "interactive"
  • Response: the same for every message (see response)

Free-form message with a button that lets the user start a WhatsApp call to the business number. When the user taps the button, a WhatsApp call to the business is initiated. Messages are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.

Note: this is a messaging feature and is separate from the VOICE_CALL template button. Requires WhatsApp Calling enabled on the phone number. See the Calling API section.

Call button

The type field must be "interactive" and the message content is sent in the voice_call object. See the general structure of interactive messages.

Body

Fields for Call button:

NameDescriptionTypeRequirements
voice_callObject for sending a message with a WhatsApp call button.ObjectRequired if you're sending a call button message.

Voice call object

NameDescriptionTypeRequirements
bodyMessage body text. Maximum 1024 characters.StringRequired.
action.nameMust be "voice_call".StringOptional.
action.parameters.display_textButton label. Maximum 20 characters. Default Call Now.StringOptional.
action.parameters.ttl_minutesTime to live for the button, in minutes. Between 1 and 43200 (30 days).IntegerOptional.
action.parameters.payloadArbitrary tracking string. Maximum 512 characters.StringOptional.

Example

Complete Call button example (HTTP request and JSON body):

HTTP request

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"type": "interactive",
"voice_call": {
"body": "You can call us on WhatsApp now for faster service!",
"action": {
"name": "voice_call",
"parameters": {
"display_text": "Call on WhatsApp",
"ttl_minutes": 100,
"payload": "payload data"
}
}
}
}'

Body

{
"from": "5215500000001",
"to": "5215500000002",
"type": "interactive",
"voice_call": {
"body": "You can call us on WhatsApp now for faster service!",
"action": {
"name": "voice_call",
"parameters": {
"display_text": "Call on WhatsApp",
"ttl_minutes": 100,
"payload": "payload data"
}
}
}
}

A minimal request without parameters uses the default button label:

{
"from": "5215500000001",
"to": "5215500000002",
"type": "interactive",
"voice_call": {
"body": "Tap below to call us about your order.",
"action": {
"name": "voice_call"
}
}
}


Previous
Location request
Next
Group messages