API Interactive List Message
This node helps you send an interactive list response message within a WhatsApp conversation. Here you can create a dynamic and customized text message and customize multiple menu options. The API response for this node should have a matching response, as shown in the example below.
Sample Response:
{
"data": {
"interactive": {
"type": "list",
"body": {
"text": "Please choose a movie from the options below."
},
"action": {
"button": "Select a Movie",
"sections": [
{
"title": "Now Playing in Cinemas",
"rows": [
{
"id": "2266",
"title": "X - Men",
"description": "Rated 9.2/10"
},
{
"id": "2267",
"title": "Incredible Hulk"
},
{
"id": "2268",
"title": "Avengers"
},
{
"id": "2269",
"title": "Mummy Returns"
},
{
"id": "2270",
"title": "Fast & The Furious"
}
]
}
]
}
}
}
}
Explanation:
Here, within the “body” parameter you can find “text” parameter that contains the message text, here you can use \n to define a new line. Within this message, you can use WhatsApp styling attributes like * symbol for bold, _ for italics, etc.
Next, you must define the button title,which appears right below the body text. You can do so by writing a title in the “button” parameter which is under the “action” parameter. The button has a text limit of 20 characters and does not allow emojis, special characters, and new line. Multilingual unicode characters are supported.
When someone clicks the button, there can be multiple sections with different list options; each section has a section title which is like a heading for a block of list options, below which come the individual list options, each list option has a title and description property. There can be a maximum of 10 list items across one or multiple sections together.
The section title is defined by the title property inside the section property. It has a text limit of 20 characters and does not allow emojis, special characters, etc. Use Unicode or regular English letters.
Under the section title, you have to define the row property, which is an array. The row propery allows you to display multiple list options. Each row object has the following properties:
- id
This property defines an id for each list item, when the user is having a conversation with the chatbot this id can be stored within the chatbot to give a perspective of the options selected by the user. and selects a particular list item, and the corresponding id will get saved, later this id can be sent to a server for further processing of data or save the users choice on your own server. The id only be a string value.
- title
After this is the title for the list item. Here you can write a brief title of the list menu item. A maximum of 20 characters can be used in this field, and it does not accept special characters, emojis, and text decoration.
- description
This is an optional property called description which allows you to write a more detailed description regarding the menu option. A maximum of 72 characters can be used in this field, and it does not accept special characters, emojis, and text decoration.