API Interactive Button
This node helps you send an interactive button response message within a WhatsApp conversation. Here you can create a dynamic and customized text message and customize multiple button options. The API response for this node should have a matching response, as shown in the example below.
Sample Response:
{
"data": {
"interactive": {
"type": "button",
"header": {
"type": "text" | "image" | "video" | "document",
"text": "HEADER TEXT", // required if type is text
"image": {
"link": "IMAGE URL"
} // required if type is image,
"video": {
"link": "VIDEO URL"
} // required if type is video,
"document": {
"link": "DOCUMENT LINK",
"filename": "DOCUMENT FILENAME"
} // required if type is document
},
"body": {
"text": "BODY_MESSAGE"
},
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "UNIQUE_BUTTON_ID_1",
"title": "BUTTON_TITLE_1"
}
},
{
"type": "reply",
"reply": {
"id": "UNIQUE_BUTTON_ID_2",
"title": "BUTTON_TITLE_2"
}
}
]
},
"footer": {
"text": "FOOTER TEXT"
}
}
}
}
Explanation:
1. Message Structure:
Your message should follow the given JSON structure:
{
"data": {
"interactive": {
"type": "button",
"header": {...},
"body": {...},
"action": {...},
"footer": {...}
}
}
}
2. Header (Optional):
- The header can be of type
text
,image
,video
, ordocument
. - Depending on the type, you need to provide the respective data:
- Text:
"header": {
"type": "text",
"text": "Your header text here"
}
- Image:
"header": {
"type": "image",
"image": {
"link": "Your image URL here"
}
}
- Video:
"header": {
"type": "video",
"video": {
"link": "Your video URL here"
}
}
- Document:
"header": {
"type": "document",
"document": {
"link": "Your document link here",
"filename": "Your document filename here"
}
}
3. Body (Required):
- The body must contain a text message.
- Example:
"body": {
"text": "Your body message here"
}
4. Action (Required):
- You can add up to 3 reply buttons.
- Each button must have a
type
,title
, and anid
. type
: Must be set to"reply"
.title
: A unique string (max 20 characters) representing the button title. Emojis are supported, but markdown is not.id
: A unique identifier for the button (max 256 characters). No leading or trailing spaces allowed.- Example:
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "Unique_Button_ID_1",
"title": "Button_Title_1"
}
},
{
"type": "reply",
"reply": {
"id": "Unique_Button_ID_2",
"title": "Button_Title_2"
}
}
]
}
5. Footer (Optional):
- The footer can contain a text message.
- Example:
"footer": {
"text": "Your footer text here"
}