Send WhatsApp Interactive Button Messages
Enhance customer engagement with interactive button messages using the DoubleTick API, allowing users to respond quickly with predefined options. π―π
API Endpoint
Use the following endpoint to send an interactive button message:
POST https://public.doubletick.io/whatsapp/message/interactive
Request Headers
{
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
}
Request Body Parameters
{
"to": "customer_number",
"from": "sender_number",
"messageId": "uuid-v4",
"content": {
"header": "Sample Header",
"body": "Sample Body",
"footer": "Sample Footer",
"buttons": [
{ "title": "Title 1", "id": "btn_1" },
{ "title": "Title 2", "id": "btn_2" }
]
}
}
Parameters
to
(string, required): Customerβs phone number in international format.from
(string, required): Your registered sender phone number in international format.messageId
(string, optional):- Message ID (UUID v4) to be used for the message.
- If not provided, a random UUID v4 will be generated automatically.
- Length to be exact 36 characters.
content
(object, required)header
(string, optional):- Header text for the message.
- Length not to be exceed 60 characters.
body
(string, required):- The main text content of the message.
- Length not to be exceed 1024 characters.
footer
(string, optional):- Footer text for the message.
- Length not to be exceed 20 characters.
buttons
(array of objects, required): A list of button options.title
(string, required):- Text displayed on the button.
- Length not to be exceed 20 characters.
id
(string, required):- A unique identifier for the button.
- Length not to be exceed 60 characters.
Responses
Success Response (201)
{
"status": "SENT",
"recipient": "customer_number",
"messageId": "unique_message_id"
}
Bad Request (400)
{
"message": "error_message",
"error": "Bad Request",
"statusCode": 400
}
Unauthorized (401)
{
"message": "Invalid public api key",
"error": "Unauthorized",
"statusCode": 401
}
Unprocessable Entity (422)
{
"message": "invalid file type for audio: text/html; charset=utf-8",
"error": "Unprocessable Entity",
"statusCode": 422
}
Best Practices
- Use clear and concise button labels for better user engagement.
- Ensure each button has a unique ID to track responses efficiently.
- Limit buttons to DoubleTick API's allowed maximum (up to 3 buttons per message).
Updated 14 days ago
Whatβs Next
Explore more message types and enhance your WhatsApp communication with DoubleTick API