Help Desk
  • Getting Started
    • ๐Ÿ™ŒWelcome to Whapi.Cloud
    • ๐Ÿ’ฐPricing
    • โ˜•Partners
    • ๐Ÿš€Getting started
    • ๐Ÿ‘จโ€๐Ÿ’ปAPI Docs
      • Developer hubs
      • Swagger environment
      • Postman collection
  • Sending
    • Introduction
    • Send text message
      • Whatsapp API send message PHP
      • Whatsapp API send message Python
      • Whatsapp API send message Node JS
      • Whatsapp API send message ะก#
      • Whatsapp API send message Java
      • API integration with VB6
      • Whatsapp API send message GO (Golang)
    • Send video, audio, image, document
    • Send Group message
    • Send post to WhatsApp Channel
    • Send message with Buttons
    • Send Emoji
    • Overview of other methods for sending
      • Send Voice message
      • Send contact (vCard)
      • Send message reactions
  • Receiving
    • Introduction
    • Webhooks
      • Our webhooks (Tracked events)
      • Where to Find the Webhook URL?
      • Set the webhook link to the channel
      • Detailed webhook settings
      • How to check the webhook?
      • Incoming webhooks format
        • Incoming message
        • Sent message
        • Chats
        • Groups
        • Account and device status
        • Other
          • Presences
          • Views of stories (statuses)
          • Story (status) from your contacts
          • Calls
      • Receive messages
        • Receive WhatsApp messages using PHP
        • Receive WhatsApp messages using Node js
        • Receive WhatsApp messages using Python
    • HTTP API
      • Retrieve a Specific User's Chat History
      • Get a full-size picture in the response
      • Get order items
      • Get a profile picture of a chat or user
    • File expiration period
  • Groups
    • Send Group message
      • Mentioning all participants in a WhatsApp group
    • Get list of group members
    • Add new member to Group
  • Channels
    • Send post to WhatsApp Channel
    • Get messages from Channels
    • Get votes from polls in the Channel
  • Communities
    • Introduction
    • Create a community
    • Add a member to a community
    • Send announcement
    • Get info on community participants
    • Add a group / Exclude a group from the community
  • Account
    • Setting "Auto Download"
    • Customizable Webhook Headers
    • How to find out the IP channel
    • How to Delete a Channel
    • Add Business Info to Invoice
  • Source code
    • WhatsApp ChatBot
      • WhatsApp Python Bot
      • WhatsApp PHP Bot
      • WhatsApp Node JS Bot
      • WhatsApp Java Bot
    • WhatsApp API Google Sheets
    • WhatsApp Phone Number Checker
    • Request Distributor (Balancer)
  • FAQ
    • Chat ID. What is it and how to get it?
    • Current status of Buttons on WhatsApp
    • How to send a paragraph (line break)
    • Inactive Links in WhatsApp Messages
    • WhatsApp Text Formatting
    • Checking if the number has Whatsapp
    • Specifics of sending messages to numbers of different countries
    • Why aren't participants being added to the group?
  • Does WhatsApp API Work with the Phone Turned Off?
  • Hints
    • Android Emulators
    • Virtual Numbers for WhatsApp
    • How to use polls as buttons?
    • How to check who blocked you in Whatsapp?
    • Setting up a WhatsApp proxy
  • Integrations
    • Make.com
      • Ready-Made Scenarios
        • WhatsApp & Whisper API: Voice-to-Text Integration
        • Automated WhatsApp Group Message Forwarding in Make.com
      • Request Scenario Setup
    • Pabbly Connect
    • Google Contacts
    • DialogFlow
    • n8n
  • Tools
    • WhatsApp Number Checker
    • Automatic warm-up module
    • WhatsApp Activity Safety Meter
    • Residential Proxies from Whapi.Cloud
  • Troubleshooting
    • Couldn't Link Device โ€“ WhatsApp QR Code or Pairing Code Fails
    • Channel status โ€œSYNC_ERRORโ€
    • Not getting a READ status on webhook
    • 429 (Too Many Requests) - Soft Ban
    • โ€œWaiting for this message. This may take a whileโ€ โ€“ WhatsApp Message Error
    • Missing push notifications after connecting to API
  • Blocking
    • How to not get Banned?
    • How to do mailings without the risk of being blocked?
    • If My Number Is Banned, Can It Be Restored?
    • Unlocking Your WhatsApp Number
    • Connecting a New WhatsApp Number After a Ban: Steps and Recommendations
    • Warming Up New Phone Numbers for WhatsApp API
  • Partner Documentation
    • Introduction
    • Partner Dashboard Overview
    • Partner Program Guidelines
      • Workflow: Step-by-Step
      • Billing for Partners
      • Allocating Days to Customer Channels: Best Practices & Guide
      • Interface for channel management
    • Partner Documentation
      • Channel creation
      • Changing channel mode
      • Channel extension
      • Channel deletion
      • Getting the list of channels
      • Notices of end of days on balance
Powered by GitBook
On this page
  • Types of buttons
  • Message with auto-reply buttons
  • Message with Call button and Link button
  • Message with copy button (OTP code)
  • Message with list of options

Was this helpful?

  1. Sending

Send message with Buttons

The method is designed to send a message with buttons to a private or group chat

PreviousSend post to WhatsApp ChannelNextSend Emoji

Last updated 6 months ago

Was this helpful?

Button message functionality is currently provided on an 'as-is' basis due to its inherent instability and dependency on Meta's updates. Please be aware that with each new WhatsApp update, the behavior of button messages may change.

For more details, visit the topic.

Peculiarities when working with buttons:

  • the button name can have no more than 25 characters;

  • there can be no more than 3 buttons of this type;

  • the button can be pressed only 1 time.

  • for current nuances of button display, see the article Current status of Buttons on WhatsApp

You can send a message with the button to either private chat or group chat. The buttons, e.g. YES / NO, can be selected by the user and used as a response to the sent message.

Types of buttons

There are four types of buttons on WhatsApp:

  • Simple text button (Quick-reply)

  • List of options

  • Link Button

  • OTP Button (Copy Button)

  • Call Button

Sending requires a request to be made to:

POST https://gate.whapi.cloud/messages/interactive


Message with auto-reply buttons

curl --request POST \
     --url https://gate.whapi.cloud/messages/interactive \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {Your_Token}' \
     --header 'content-type: application/json' \
     --data '
{
  "header": {
    "text": "Header with text"
  },
  "body": {
    "text": "Body message"
  },
  "footer": {
    "text": "Footer message"
  },
  "action": {
    "buttons": [
      {
        "type": "quick_reply",
        "title": "Button1",
        "id": "randomId1"
      },
      {
        "type": "quick_reply",
        "title": "Button2",
        "id": "randomId2"
      }
    ]
  },
  "type": "button",
  "to": "61371989950"
}
'

When the recipient clicks on a button, it automatically sends a reply to your message containing the buttonโ€™s text. If you've set up a webhook for the channel, you'll receive a callback with both the button ID and the text.

{
  "messages": [
    {
      "id": "g0jEG0ZsSobn4yNGGU3TAg-gDYOS60TLw",
      "from_me": false,
      "type": "reply",
      "chat_id": "61371989950@s.whatsapp.net",
      "timestamp": 1726126124,
      "source": "mobile",
      "chat_name": "Jonathan Customer",
      "reply": {
        "type": "buttons_reply",
        "buttons_reply": {
          "id": "ButtonsV3:",
          "title": ""
        }
      },
      "context": {
        "quoted_id": "yqKj.Z7XWg0g1lA-wD8Sij1GoQ",
        "quoted_author": "919984351847",
        "quoted_content": {
          "header": "Header with text",
          "body": "Body message",
          "footer": "Footer message",
          "buttons": [
            {
              "type": "quick_reply",
              "text": "Button1",
              "id": "ButtonsV3:randomId1"
            },
            {
              "type": "quick_reply",
              "text": "Button2",
              "id": "ButtonsV3:randomId2"
            }
          ]
        },
        "quoted_type": "hsm"
      },
      "from": "61371989950",
      "from_name": "Jonathan"
    }
  ],
  "event": {
    "type": "messages",
    "event": "post"
  },
  "channel_id": "MANTIS-PF238"
}

Note that the callback may be slightly different if the customer clicked the button in Web WhatsApp:

{
  "messages": [
    {
      "id": "g0jEG0ZsSobn4yNGGU3TAg-gDYOS60TLw",
      "from_me": false,
      "type": "reply",
      "chat_id": "61371989950@s.whatsapp.net",
      "timestamp": 1726126124,
      "source": "mobile",
      "chat_name": "Jonathan Customer",
      "reply": {
        "type": "buttons_reply",
        "buttons_reply": {
          "id": "ButtonsV3:",
          "title": ""
        }
      },
      "context": {
        "quoted_id": "yqKj.Z7XWg0g1lA-wD8Sij1GoQ",
        "quoted_author": "919984351847",
        "quoted_content": {
          "body": "Body message"
        },
        "quoted_type": "text"
      },
      "from": "61371989950",
      "from_name": "Jonathan"
    }
  ],
  "event": {
    "type": "messages",
    "event": "post"
  },
  "channel_id": "MANTIS-PF238"
}

Message with Call button and Link button

curl --request POST \
     --url https://gate.whapi.cloud/messages/interactive \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {Your_Token}' \
     --header 'content-type: application/json' \
     --data '
{
  "header": {
    "text": "Header with text"
  },
  "body": {
    "text": "Body message"
  },
  "footer": {
    "text": "Footer message"
  },
  "action": {
    "buttons": [
      {
        "type": "call",
        "title": "Call us",
        "id": "randomId1",
        "phone_number": "61371989950"
      },
      {
        "type": "url",
        "title": "Look at the website",
        "id": "randomId2",
        "url": "https://whapi.cloud"
      }
    ]
  },
  "type": "button",
  "to": "61371989950"
}
'

Unfortunately, WhatsApp does not track the event of clicking these buttons. Therefore, it is not possible to get a webhook for pressing these buttons.


Message with copy button (OTP code)

You can pass any text to the snippet that will be copied after the button is clicked.

curl --request POST \
     --url https://gate.whapi.cloud/messages/interactive \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {Your_Token}' \
     --header 'content-type: application/json' \
     --data '
{
  "header": {
    "text": "Header with text"
  },
  "body": {
    "text": "Body message"
  },
  "footer": {
    "text": "Footer message"
  },
  "action": {
    "buttons": [
      {
        "type": "copy",
        "title": "Copy OTP",
        "id": "randomId1",
        "copy_code": "65545"
      }
    ]
  },
  "type": "button",
  "to": "61371989950"
}
'

Unfortunately, WhatsApp does not track the event of clicking these buttons. Therefore, it is not possible to get a webhook for pressing these buttons.


Message with list of options

curl --request POST \
     --url https://gate.whapi.cloud/messages/interactive \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {Your_Token}' \
     --header 'content-type: application/json' \
     --data '
{
  "header": {
    "text": "Header with text"
  },
  "body": {
    "text": "Body message"
  },
  "footer": {
    "text": "Footer message"
  },
"action": {
    "list": {
      "sections": [
        {
          "title": "What's your favorite hamburger?",
          "rows": [
            {
              "title": "Hamburger without cheese",
              "id": "r1",
              "description": "A burger without cheese or sauce is often referred to as a \"plain\" burger."
            },
            {
              "id": "r2",
              "title": "Cheeseburger",
              "description": "A cheeseburger is a hamburger with a slice of melted cheese on top of the meat patty"
            }
          ]
        }
      ],
      "label": "Pick a hamburger!"
    }
  },
  "type": "list",
  "to": "61371989950"
}
'

When the recipient clicks on a button, it automatically sends a reply to your message containing the buttonโ€™s text. If you've set up a webhook for the channel, you'll receive a callback with both the button ID and the text.

{
  "messages": [
    {
      "id": "A5y7S8JfMsgaYiXZC6Royw-gMoOS60TLw",
      "from_me": false,
      "type": "reply",
      "chat_id": "61371989950@s.whatsapp.net",
      "timestamp": 1726127469,
      "source": "mobile",
      "chat_name": "Jonathan Customer",
      "reply": {
        "type": "list_reply",
        "list_reply": {
          "id": "ListV3:",
          "title": "",
          "description": "A burger without cheese or sauce is often referred to as a \"plain\" burger."
        }
      },
      "context": {
        "quoted_id": "yqL1GxfdT7pX48I-wEASij1GoQ",
        "quoted_author": "919984351847",
        "quoted_content": {
          "title": "Header with text",
          "description": "Body message",
          "label": "Pick a hamburger!",
          "footer": "Footer message",
          "sections": [
            {
              "title": "What's your favorite hamburger?",
              "rows": [
                {
                  "id": "ListV3:r1",
                  "title": "Hamburger without cheese",
                  "description": "A burger without cheese or sauce is often referred to as a \"plain\" burger."
                },
                {
                  "id": "ListV3:r2",
                  "title": "Cheeseburger",
                  "description": "A cheeseburger is a hamburger with a slice of melted cheese on top of the meat patty"
                }
              ]
            }
          ]
        },
        "quoted_type": "list"
      },
      "from": "61371989950",
      "from_name": "Jonathan"
    }
  ],
  "event": {
    "type": "messages",
    "event": "post"
  },
  "channel_id": "MANTIS-PF238"
}

We continue to explore WhatsApp's capabilities and add to our methods for automation. In the upcoming updates we will have the ability to send messages with picture/media and buttons.

If you have any questions, our team is always available to help you.

Button Status
๐ŸŽฎ Send interactive messageWhapi Cloud - Whatsapp API for developers
Endpoint for sending messages with different buttons
Logo
Example of a message with quick reply buttons.
Example of a message with callback buttons and a link to a third-party site
Example of a message with a button to copy hidden text
Example of a message with a button with a list of options
The list of options will expand if the user clicks on it.