SendInteractiveButtonsReply#
The method is designed to send a message with buttons to personal chats. The method sends buttons that return text to the chat.
Beta version
The functionality is in beta mode. Functions can be changed and may also work unstably.
Request#
To send a message with buttons to personal chats, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/sendInteractiveButtonsReply/{{apiTokenInstance}}
For apiUrl
, idInstance
and apiTokenInstance
request parameters, refer to Before you start section.
Features when working with buttons#
- The button name can have no more than 25 characters.
- There can be no more than 3 buttons in one message.
- The button can only be pressed once.
Request parameters#
Parameter | Type | Mandatory | Description |
---|---|---|---|
chatId | string | Yes | Chat Id |
header | string | No | Message title |
body | string | Yes | Message text. Emoji symbols are supported 😃 |
footer | string | No | Message footer. Convenient for visually highlighting text that relates to buttons |
buttons | array | Yes | Message buttons |
buttons
array parameters#
Parameter | Type | Mandatory | Description |
---|---|---|---|
buttonId | string | Yes | Button ID |
buttonText | string | Yes | Text on the button |
Request body example#
Sending a message to a personal chat:
{
"chatId": "79876543210@c.us",
"header": "Header",
"body": "Body",
"footer": "Footer",
"buttons": [
{
"buttonId": "1",
"buttonText": "First Button"
},
{
"buttonId": "2",
"buttonText": "Second Button"
},
{
"buttonId": "3",
"buttonText": "Third Button"
}
]
}
Response#
Response parameters#
Parameter | Type | Description |
---|---|---|
idMessage | string | Outgoing message Id |
Response body example#
{
"idMessage": "3EB0C767D097B7C7C030"
}
Example of display at the recipient#
SendInteractiveButtonsReply errors#
For a list of errors common to all methods, refer to Common errors section
Request examples#
curl --location --request POST '{{apiUrl}}/waInstance{{idInstance}}/sendInteractiveButtonsReply/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"chatId": "79581004388@c.us",
"header": "Header",
"body": "Body",
"footer": "Footer",
"buttons": [
{
"buttonId": "1",
"buttonText": "First Button"
},
{
"buttonId": "2",
"buttonText": "Second Button"
},
{
"buttonId": "3",
"buttonText": "Third Button"
}
]
}'