WabaBroadcast
Broadcast message can be sent using pre-approved template. A template message parameters consists of message part, namely:
header: Add a title or choose which type of media.body: Text for your message in the language you've selected.buttons: Message button parameters.
Header
Media file is provided via header.
The media file types that are allowed are document, image and video.
Only one media header is allowed per message.
Apart from media you can have a message title with max 1 parameter.
» Media (image, video and document)
filename parameter is for document media type only.
The extension of the filename will specify what format the document is displayed as in WhatsApp.
{
"type": "document",
"link": "https://url.to/your-document-file.pdf",
"caption": "Optional. Text caption (for document, image and video only)",
"filename": "document-filename.pdf"
}
» Text
Rules:
- Max 60 characters for header text including the text parameter value (if any)
- Max parameter number: 1
- Can not contain newlines, formatting characters, emojis, or asterisks
- When sending a message parameterized header limited to 60 characters, including the parameter value
{ "type": "text": "text": "Value for param 1 on header" }
Body
[
{ "type": "text": "text": "Value for param 1 on body" },
{ "type": "text": "text": "Value for param 2 on body" }
]
Rules:
- Max 1024 characters for the template text and all parameter values
Buttons
Buttons are optional interactive components that perform specific actions when tapped.
Button Types
Copy Code
A text string (defined when the template is sent in a template message) to the device’s clipboard when tapped by the app user.
Rules:
- Templates are limited to one copy code button.
- Max length: 16 characters
Call Button
Make a WhatsApp call to the business when tapped by the app user.
Rules:
- Parameter component max character length:
text: 20 charactersphone_number: 20 characters
{
"type": "PHONE_NUMBER",
"text": "Call",
"phone_number": "YOUR PHONE NUMBER"
}
Quick Reply
Custom text-only buttons that immediately message you with the specified text string when tapped by the app user.
Rules:
- Max length: 25 characters
[
{
"sub_type": "QUICK_REPLY",
"index": 0,
"parameters": {
"type": "payload",
"payload": "ANY_PAYLOAD"
}
},
{
"sub_type": "QUICK_REPLY",
"index": 1,
"parameters": {
"type": "payload",
"payload": "MORE PAYLOAD"
}
}
]
URL
Load the specified URL in the device’s default web browser when tapped by the app user.
Rules:
- A template is limited to two URL buttons.
- Max text length: 25 characters
- If your URL button parameter values contain special characters, you must percent-encode them before including them in your send template message request
Example:
[
{
"sub_type": "URL",
"index": 0,
"parameters": {
"type": "payload",
"payload": "to-be-appended-to-predefined-url-prefix"
}
}
]
Templates composed of 4 or more buttons, or a quick reply button and one or more buttons of another type, cannot be viewed on WhatsApp desktop clients. WhatsApp users who receive one of these template messages will be prompted to view the message on a phone instead.
More Rules
Quick Button Combination
If using quick reply buttons with other buttons, buttons must be organized into two groups: quick reply buttons and non-quick reply buttons. If grouped incorrectly, the API will return an error indicating an invalid combination.
Examples of valid groupings:
- Quick Reply, Quick Reply
- Quick Reply, Quick Reply, URL, Phone
- URL, Phone, Quick Reply, Quick Reply