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.
![Image Alt Text](https://d7networks.com/media/images/10.png)
Call-to-Action URL Button Messages
![Image Alt Text](https://d7networks.com/media/images/11.png)
Reply Buttons
![Image Alt Text](https://d7networks.com/media/images/12.png)
List
Interactive Object
Parameter | Type | Description |
---|---|---|
*type | String | The type of interactive message you want to send. Supported values: button, list |
*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
Note:
The Interactive message with type list can only have header type: text.
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.
![Image Alt Text](https://d7networks.com/media/images/12.png)
![Image Alt Text](https://d7networks.com/media/images/13.png)
![Image Alt Text](https://d7networks.com/media/images/14.png)
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 |