Whatsapp Interactive Messages
Interactive messages give your users a simpler way to find and select what they want from your business on WhatsApp. These messages enable two-way communication where users can interact with the message by selecting options, providing input, or taking specific actions within the message itself.
Interactive Object
Parameter | Type | Description |
---|---|---|
*type | String | The type of interactive message you want to send. Supported values: button, list, location_request_message, address_message |
*body | Object | The body object contains text parameter. Its required if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters. |
footer | Object | The footer object contains text field. Required if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters. |
header | Object | Optional. Header content displayed on top of a message. See Header Object. |
*action | Object | Action you want the user to perform after reading the message. See Action Object. |
Header Object
Parameter | Type | Description |
---|---|---|
type | String | The header type you would like to use. Supported values: text- Used for List Messages & Reply Buttons, video- Used for Reply Buttons, image- Used for Reply Buttons, document- Used for Reply Buttons. |
document | Object | Required if type is set to document. Contains two parameters filename and link. |
image | Object | Required if type is set to image. Contains only link parameter. |
text | String | Required if type is set to text. Text for the header. Formatting allows emojis, but not markdown. Maximum length: 60 characters. |
video | Object | Required if type is set to video. Contains only link parameter. |
"interactive": {
"type": "cta_url",
/* Header optional */
"header": {
"type": "text",
"text": "<HEADER_TEXT>"
},
/* Body optional */
"body": {
"text": "<BODY_TEXT>"
},
/* Footer optional */
"footer": {
"text": "<FOOTER_TEXT>"
},
"action": {
"name": "cta_url",
"parameters": {
"display_text": "<BUTTON_TEXT>",
"url": "<BUTTON_URL>"
}
}
}
Action Object
Interactive messages can be categorized into three, based on action object as follows:
- Interactive Message with Call-to-Action URL Button Messages
- Interactive Message with Reply Buttons
- Interactive Message with List
- Interactive Message with Location Request Button
- Interactive Message with Address Message
Note:
The Interactive message with type list can only have header type: text.
Header and Footer are not allowed for Interactive location request messages.
Interactive address messages are only supported in India and Singapore.
CTA URL button messages allow you to map any URL to a button so you don't have to include the raw URL in the message body.
CTA Action objects:
Parameter | Type | Description |
---|---|---|
parameters | Array(Object) | Required for Call-to-Action Buttons. You can have up to one button. See Parameters Object |
Parameters Object
Parameter | Type | Description | Value / Pattern |
---|---|---|---|
*display_text | String | CTA Button text. | See Dates |
*url | String | URL to load in the device's default web browser when tapped by the WhatsApp user. | https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4 |
Programing Examples:
Interactive reply buttons messages allow you to send up to three predefined replies for users to choose from. Users can respond to a message by selecting one of the predefined buttons, which triggers a messages webhook describing their selection.
Reply Buttons Action objects
Parameter | Type | Description |
---|---|---|
buttons | Array(Object) | Required for Reply Buttons. You can have up to 3 buttons. You cannot have leading or trailing spaces when setting the ID. A button object can contain the following parameters: type: only supported type is reply (for Reply Button) title: Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters. id: Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters. |
Buttons Object
Parameter | Type | Description | Value / Pattern |
---|---|---|---|
*type | String | Only supported type is reply. | reply |
*title | String | Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters. | Change |
*id | String | Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters. | 1 |
Programing Examples:
Interactive list messages allow you to present WhatsApp users with a list of options to choose. When a user taps the button in the message, it displays a modal that lists the options available. Users can then choose one option and their selection will be sent as a reply.
List Action objects
Parameter | Type | Description |
---|---|---|
button | String | Required. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters. |
sections | Array(Object) | Required. Array of section objects. Minimum of 1, maximum of 10 |
Sections Object
Parameter | Type | Description | Value / Pattern |
---|---|---|---|
*title | String | Required if the message has more than one section. Title of the section. Maximum length: 24 characters. | See Dates |
*rows | List | Contains a list of rows object. You can have a total of 10 rows across your sections. Each row must have a *title: Maximum length: 24 characters *id: Maximum length: 200 characters description: Maximum length: 72 characters |
Programing Examples:
Location request messages display body text and a send location button. When a WhatsApp user taps the button, a location sharing screen appears which the user can then use to share their location.
Reply Buttons Action objects
Programing Examples:
Address messages give your users a simpler way to share the shipping address with the business on WhatsApp. Currently address messages are supported in the following two countries: India and Singapore.
Reply Buttons Action objects
Parameter | Type | Description | Supported Countries |
---|---|---|---|
name | string | value should be address_message | India, Singapore |
phone_number | string | Phone Number. Valid phone numbers only | India, Singapore |
in_pin_code | string | Pin Code | India |
sg_post_code | number | Post Code | Singapore |
house_number | string | Flat/House Number | India |
floor_number | string | Floor Number | India |
tower_number | string | Tower Number | India |
building_name | string | Building/Apartment Name | India |
address | string | Address | India, Singapore |
landmark_area | string | Landmark/Area | India |
unit_number | string | Unit number | Singapore |
city | string | City | India, Singapore |
state | string | State | India |
"action": {
"parameters": {
"country": "IN",
"values": {
"name": "Steni Mariya",
"phone_number": "+97156965xxxx",
"in_pin_code": 680026,
"house_number": "45",
"floor_number": "3",
"tower_number": 34,
"building_name": "Excel",
"address": "House name",
"landmark_area": "Near Mobile Tower",
"city": "Thrissur",
"state": "Kerala"
},
"saved_addresses": [
{
"id": "address1",
"value": {
"name": "Lifiya Mariya",
"phone_number": "+971569xxxxx",
"in_pin_code": 680026,
"house_number": "45",
"floor_number": "3",
"tower_number": 34,
"building_name": "Excel",
"address": "House name",
"landmark_area": "Near Mobile Tower",
"city": "Thrissur",
"state": "Kerala"
}
},
{
"id": "address1",
"value": {
"name": "Mariya",
"phone_number": "+971569658xxx",
"in_pin_code": 680026,
"house_number": "45",
"floor_number": "3",
"tower_number": 34,
"building_name": "Excel",
"address": "House name",
"landmark_area": "Near Mobile Tower",
"city": "Thrissur",
"state": "Kerala"
}
}
]
}
}