Skip to content

SendInteractiveButtons#

Postman Apidog

The method is designed to send a message with buttons to personal chats. The method sends buttons to transmit information like links and a phone number to call.

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}}/sendInteractiveButtons/{{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.

Supported operating systems, platforms#

All supported platforms are listed for the current versions of WhatsApp.

OS or platform Method support
Whatsapp WEB Yes
Windows Desktop Not supported
Android Yes
iOS Yes
iPadOS Yes

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
type string Yes The type of message to send. There are 3 types: copy, call, and url. COPY - allows you to quickly copy the contents of the button. CALL - allows you to start a call by pressing the button. URL - allows you to open a link by pressing the button.
buttonId string Yes Button ID
buttonText string Yes Text on the button
copyCode string No Field for a button of the COPY type, is the value to copy when the button is clicked
phoneNumber string No Field for a button of the CALL type, the phone number to which a call will be made when the button is clicked
url string No Field for a button of the URL type, the link to which a transition will be made when the button is clicked

Request body example#

Sending a message to a personal chat:

{
    "chatId": "79876543210@c.us",
    "header": "Header",
    "body": "Body",
    "footer": "Footer",
    "buttons": [
        {
            "type": "copy",
            "buttonId": "1",
            "buttonText": "Copy me",
            "copyCode": "3333"
        },
        {
            "type": "call",
            "buttonId": "2",
            "buttonText": "Call me",
            "phoneNumber": "79329843267"
        },
        {
            "type": "url",
            "buttonId": "3",
            "buttonText": "Green-api",
            "url": "https://green-api.com"
        }
    ]
}

Sending messages with different button types#

Attention: To send a message with different button types together, follow the instructions.

There are more restrictions for sending messages of this type.

List of supported operating systems and platforms#

The following systems and platforms are supported for sending mixed-type buttons

All supported platforms are listed for the latest versions of WhatsApp.

OS or platform Method support
Whatsapp WEB Not supported
Windows Desktop Not supported
Android Yes
iOS Yes
iPadOS Yes

Features when working with buttons#

There are the following restrictions for sending mixed-type buttons:
- the button name can be no more than 25 characters.
- there can be no more than 3 buttons in one message.
- the button can be clicked only once.
- to create a button with reply, use the rules of the SendInteractiveButtonsReply method.

Sending a message to a private chat of mixed buttons#

{
    "chatId": "79581004388@c.us",
    "header": "Different button options",
    "body": "Different levels of headings",
    "footer": "But still in testing",
    "buttons": [
        {
            "type": "url",
            "buttonId": "1",
            "buttonText": "Green-api",
            "url": "http://green-api.com"
        },
        {
            "type": "reply",
            "buttonId": "2",
            "buttonText": "Reply button"
        }
    ]
}

Response#

Response parameters#

Parameter Type Description
idMessage string Outgoing message Id

Response body example#

{
    "idMessage": "3EB0C767D097B7C7C030"
}

Example of display at the recipient#

alt text

SendInteractiveButtons errors#

For a list of errors common to all methods, refer to Common errors section

Request examples#

curl --location --request POST '{{apiUrl}}/waInstance{{idInstance}}/sendInteractiveButtons/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "chatId": "79876543210@c.us",
    "header": "Header",
    "body": "Body",
    "footer": "Footer",
    "buttons": [
        {
            "type": "copy",
            "buttonId": "1",
            "buttonText": "Copy me",
            "copyCode": "3333"
        },
        {
            "type": "call",
            "buttonId": "2",
            "buttonText": "Call me",
            "phoneNumber": "79329843267"
        },
        {
            "type": "url",
            "buttonId": "3",
            "buttonText": "Green-api",
            "url": "https://green-api.com"
        }
    ]
}'