Skip to main content
POST
/
whatsapp
/
send
/
interactive-buttons
Send Interactive Buttons
curl --request POST \
  --url https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data apiToken=API-KEY \
  --data phone_number_id=PHONE-NUMBER-ID \
  --data phone_number=PHONE-NUMBER \
  --data 'message=Choose an option' \
  --data 'buttons=[{"id":"buy_now","title":"Buy Now"},{"id":"details","title":"View Details"}]' \
  --data 'button_header_text=<string>' \
  --data 'button_footer_text=<string>' \
  --data 'media_url=<string>' \
  --data 'media_id=<string>' \
  --data 'media_type=<string>' \
  --data 'media_name=<string>'
import requests

url = "https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons"

payload = {
"apiToken": "API-KEY",
"phone_number_id": "PHONE-NUMBER-ID",
"phone_number": "PHONE-NUMBER",
"message": "Choose an option",
"buttons": "[{\"id\":\"buy_now\",\"title\":\"Buy Now\"},{\"id\":\"details\",\"title\":\"View Details\"}]",
"button_header_text": "<string>",
"button_footer_text": "<string>",
"media_url": "<string>",
"media_id": "<string>",
"media_type": "<string>",
"media_name": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
apiToken: 'API-KEY',
phone_number_id: 'PHONE-NUMBER-ID',
phone_number: 'PHONE-NUMBER',
message: 'Choose an option',
buttons: '[{"id":"buy_now","title":"Buy Now"},{"id":"details","title":"View Details"}]',
button_header_text: '<string>',
button_footer_text: '<string>',
media_url: '<string>',
media_id: '<string>',
media_type: '<string>',
media_name: '<string>'
})
};

fetch('https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "apiToken=API-KEY&phone_number_id=PHONE-NUMBER-ID&phone_number=PHONE-NUMBER&message=Choose%20an%20option&buttons=%5B%7B%22id%22%3A%22buy_now%22%2C%22title%22%3A%22Buy%20Now%22%7D%2C%7B%22id%22%3A%22details%22%2C%22title%22%3A%22View%20Details%22%7D%5D&button_header_text=%3Cstring%3E&button_footer_text=%3Cstring%3E&media_url=%3Cstring%3E&media_id=%3Cstring%3E&media_type=%3Cstring%3E&media_name=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons"

payload := strings.NewReader("apiToken=API-KEY&phone_number_id=PHONE-NUMBER-ID&phone_number=PHONE-NUMBER&message=Choose%20an%20option&buttons=%5B%7B%22id%22%3A%22buy_now%22%2C%22title%22%3A%22Buy%20Now%22%7D%2C%7B%22id%22%3A%22details%22%2C%22title%22%3A%22View%20Details%22%7D%5D&button_header_text=%3Cstring%3E&button_footer_text=%3Cstring%3E&media_url=%3Cstring%3E&media_id=%3Cstring%3E&media_type=%3Cstring%3E&media_name=%3Cstring%3E")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("apiToken=API-KEY&phone_number_id=PHONE-NUMBER-ID&phone_number=PHONE-NUMBER&message=Choose%20an%20option&buttons=%5B%7B%22id%22%3A%22buy_now%22%2C%22title%22%3A%22Buy%20Now%22%7D%2C%7B%22id%22%3A%22details%22%2C%22title%22%3A%22View%20Details%22%7D%5D&button_header_text=%3Cstring%3E&button_footer_text=%3Cstring%3E&media_url=%3Cstring%3E&media_id=%3Cstring%3E&media_type=%3Cstring%3E&media_name=%3Cstring%3E")
.asString();
require 'uri'
require 'net/http'

url = URI("https://platform.chatsyncs.com/api/v1/whatsapp/send/interactive-buttons")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "apiToken=API-KEY&phone_number_id=PHONE-NUMBER-ID&phone_number=PHONE-NUMBER&message=Choose%20an%20option&buttons=%5B%7B%22id%22%3A%22buy_now%22%2C%22title%22%3A%22Buy%20Now%22%7D%2C%7B%22id%22%3A%22details%22%2C%22title%22%3A%22View%20Details%22%7D%5D&button_header_text=%3Cstring%3E&button_footer_text=%3Cstring%3E&media_url=%3Cstring%3E&media_id=%3Cstring%3E&media_type=%3Cstring%3E&media_name=%3Cstring%3E"

response = http.request(request)
puts response.read_body
{
  "status": "1",
  "wa_message_id": "wamid.HBgNODgwMTcyMzMwOTAwMxUCABEYEjlGQkY3MEFEMEVGODhCNDkxNQA=",
  "message": "Message sent successfully."
}
Sends a session message with up to 3 tappable reply buttons, optionally with an image, video, or document attached as the header.
Like Send Text Message, this is a session message — only deliverable within the 24-hour window after the recipient last messaged you.

Body

application/x-www-form-urlencoded
apiToken
string
required

Your ChatSyncs API key (not a WhatsApp/Meta access token). Where to find it.

Example:

"API-KEY"

phone_number_id
string
required

The WhatsApp account's phone number ID. Where to find it.

Example:

"PHONE-NUMBER-ID"

phone_number
string
required

The subscriber's phone number, with country code, digits only.

Example:

"PHONE-NUMBER"

message
string
required

The message body shown above the buttons.

Example:

"Choose an option"

buttons
string
required

JSON array of 1 to 3 reply buttons. Each item is a string or an object with id and title (max 20 characters).

Example:

"[{\"id\":\"buy_now\",\"title\":\"Buy Now\"},{\"id\":\"details\",\"title\":\"View Details\"}]"

button_header_text
string

Optional text header. Ignored if a media header is sent instead.

Optional footer text shown below the buttons.

media_url
string

Public HTTPS URL of an image, video, or document to use as the header. Use either media_url or media_id, not both.

media_id
string

A WhatsApp media ID from Upload Media. Requires media_type when used.

media_type
string

One of image, video, document. Required when using media_id, or when media_url has no file extension. Audio is not supported.

media_name
string

Filename to display — only used when media_type is document.

Response

200 - application/json

Standard ChatSyncs response. status is "1" on success and "0" on failure.

status
string

"1" = success, "0" = failure.

message
string

Human-readable result message.