Dispatch Quick Reply Buttons
curl --request POST \
--url https://app.wachat.net/api/v1/send/button \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instanceName": "my-instance-01",
"number": "628123456789",
"type": "interactive",
"interactive": {
"type": "button",
"title": "Confirm Attendance",
"body": "Will you be attending the event tomorrow morning?",
"footer": "Wachat",
"buttons": [
{
"buttonId": "btn_yes",
"buttonText": {
"displayText": "Yes, I m Coming"
},
"type": 1
},
{
"buttonId": "btn_no",
"buttonText": {
"displayText": "Sorry, Unable to attend"
},
"type": 2
}
]
},
"delay": 1000
}
'import requests
url = "https://app.wachat.net/api/v1/send/button"
payload = {
"instanceName": "my-instance-01",
"number": "628123456789",
"type": "interactive",
"interactive": {
"type": "button",
"title": "Confirm Attendance",
"body": "Will you be attending the event tomorrow morning?",
"footer": "Wachat",
"buttons": [
{
"buttonId": "btn_yes",
"buttonText": { "displayText": "Yes, I m Coming" },
"type": 1
},
{
"buttonId": "btn_no",
"buttonText": { "displayText": "Sorry, Unable to attend" },
"type": 2
}
]
},
"delay": 1000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instanceName: 'my-instance-01',
number: '628123456789',
type: 'interactive',
interactive: {
type: 'button',
title: 'Confirm Attendance',
body: JSON.stringify('Will you be attending the event tomorrow morning?'),
footer: 'Wachat',
buttons: [
{buttonId: 'btn_yes', buttonText: {displayText: 'Yes, I m Coming'}, type: 1},
{
buttonId: 'btn_no',
buttonText: {displayText: 'Sorry, Unable to attend'},
type: 2
}
]
},
delay: 1000
})
};
fetch('https://app.wachat.net/api/v1/send/button', 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://app.wachat.net/api/v1/send/button",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instanceName' => 'my-instance-01',
'number' => '628123456789',
'type' => 'interactive',
'interactive' => [
'type' => 'button',
'title' => 'Confirm Attendance',
'body' => 'Will you be attending the event tomorrow morning?',
'footer' => 'Wachat',
'buttons' => [
[
'buttonId' => 'btn_yes',
'buttonText' => [
'displayText' => 'Yes, I m Coming'
],
'type' => 1
],
[
'buttonId' => 'btn_no',
'buttonText' => [
'displayText' => 'Sorry, Unable to attend'
],
'type' => 2
]
]
],
'delay' => 1000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.wachat.net/api/v1/send/button"
payload := strings.NewReader("{\n \"instanceName\": \"my-instance-01\",\n \"number\": \"628123456789\",\n \"type\": \"interactive\",\n \"interactive\": {\n \"type\": \"button\",\n \"title\": \"Confirm Attendance\",\n \"body\": \"Will you be attending the event tomorrow morning?\",\n \"footer\": \"Wachat\",\n \"buttons\": [\n {\n \"buttonId\": \"btn_yes\",\n \"buttonText\": {\n \"displayText\": \"Yes, I m Coming\"\n },\n \"type\": 1\n },\n {\n \"buttonId\": \"btn_no\",\n \"buttonText\": {\n \"displayText\": \"Sorry, Unable to attend\"\n },\n \"type\": 2\n }\n ]\n },\n \"delay\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.wachat.net/api/v1/send/button")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instanceName\": \"my-instance-01\",\n \"number\": \"628123456789\",\n \"type\": \"interactive\",\n \"interactive\": {\n \"type\": \"button\",\n \"title\": \"Confirm Attendance\",\n \"body\": \"Will you be attending the event tomorrow morning?\",\n \"footer\": \"Wachat\",\n \"buttons\": [\n {\n \"buttonId\": \"btn_yes\",\n \"buttonText\": {\n \"displayText\": \"Yes, I m Coming\"\n },\n \"type\": 1\n },\n {\n \"buttonId\": \"btn_no\",\n \"buttonText\": {\n \"displayText\": \"Sorry, Unable to attend\"\n },\n \"type\": 2\n }\n ]\n },\n \"delay\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.wachat.net/api/v1/send/button")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instanceName\": \"my-instance-01\",\n \"number\": \"628123456789\",\n \"type\": \"interactive\",\n \"interactive\": {\n \"type\": \"button\",\n \"title\": \"Confirm Attendance\",\n \"body\": \"Will you be attending the event tomorrow morning?\",\n \"footer\": \"Wachat\",\n \"buttons\": [\n {\n \"buttonId\": \"btn_yes\",\n \"buttonText\": {\n \"displayText\": \"Yes, I m Coming\"\n },\n \"type\": 1\n },\n {\n \"buttonId\": \"btn_no\",\n \"buttonText\": {\n \"displayText\": \"Sorry, Unable to attend\"\n },\n \"type\": 2\n }\n ]\n },\n \"delay\": 1000\n}"
response = http.request(request)
puts response.read_bodyMessages
Send Reply Buttons
Send an interactive WhatsApp quick reply button message.
POST
/
send
/
button
Dispatch Quick Reply Buttons
curl --request POST \
--url https://app.wachat.net/api/v1/send/button \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instanceName": "my-instance-01",
"number": "628123456789",
"type": "interactive",
"interactive": {
"type": "button",
"title": "Confirm Attendance",
"body": "Will you be attending the event tomorrow morning?",
"footer": "Wachat",
"buttons": [
{
"buttonId": "btn_yes",
"buttonText": {
"displayText": "Yes, I m Coming"
},
"type": 1
},
{
"buttonId": "btn_no",
"buttonText": {
"displayText": "Sorry, Unable to attend"
},
"type": 2
}
]
},
"delay": 1000
}
'import requests
url = "https://app.wachat.net/api/v1/send/button"
payload = {
"instanceName": "my-instance-01",
"number": "628123456789",
"type": "interactive",
"interactive": {
"type": "button",
"title": "Confirm Attendance",
"body": "Will you be attending the event tomorrow morning?",
"footer": "Wachat",
"buttons": [
{
"buttonId": "btn_yes",
"buttonText": { "displayText": "Yes, I m Coming" },
"type": 1
},
{
"buttonId": "btn_no",
"buttonText": { "displayText": "Sorry, Unable to attend" },
"type": 2
}
]
},
"delay": 1000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instanceName: 'my-instance-01',
number: '628123456789',
type: 'interactive',
interactive: {
type: 'button',
title: 'Confirm Attendance',
body: JSON.stringify('Will you be attending the event tomorrow morning?'),
footer: 'Wachat',
buttons: [
{buttonId: 'btn_yes', buttonText: {displayText: 'Yes, I m Coming'}, type: 1},
{
buttonId: 'btn_no',
buttonText: {displayText: 'Sorry, Unable to attend'},
type: 2
}
]
},
delay: 1000
})
};
fetch('https://app.wachat.net/api/v1/send/button', 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://app.wachat.net/api/v1/send/button",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instanceName' => 'my-instance-01',
'number' => '628123456789',
'type' => 'interactive',
'interactive' => [
'type' => 'button',
'title' => 'Confirm Attendance',
'body' => 'Will you be attending the event tomorrow morning?',
'footer' => 'Wachat',
'buttons' => [
[
'buttonId' => 'btn_yes',
'buttonText' => [
'displayText' => 'Yes, I m Coming'
],
'type' => 1
],
[
'buttonId' => 'btn_no',
'buttonText' => [
'displayText' => 'Sorry, Unable to attend'
],
'type' => 2
]
]
],
'delay' => 1000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.wachat.net/api/v1/send/button"
payload := strings.NewReader("{\n \"instanceName\": \"my-instance-01\",\n \"number\": \"628123456789\",\n \"type\": \"interactive\",\n \"interactive\": {\n \"type\": \"button\",\n \"title\": \"Confirm Attendance\",\n \"body\": \"Will you be attending the event tomorrow morning?\",\n \"footer\": \"Wachat\",\n \"buttons\": [\n {\n \"buttonId\": \"btn_yes\",\n \"buttonText\": {\n \"displayText\": \"Yes, I m Coming\"\n },\n \"type\": 1\n },\n {\n \"buttonId\": \"btn_no\",\n \"buttonText\": {\n \"displayText\": \"Sorry, Unable to attend\"\n },\n \"type\": 2\n }\n ]\n },\n \"delay\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.wachat.net/api/v1/send/button")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instanceName\": \"my-instance-01\",\n \"number\": \"628123456789\",\n \"type\": \"interactive\",\n \"interactive\": {\n \"type\": \"button\",\n \"title\": \"Confirm Attendance\",\n \"body\": \"Will you be attending the event tomorrow morning?\",\n \"footer\": \"Wachat\",\n \"buttons\": [\n {\n \"buttonId\": \"btn_yes\",\n \"buttonText\": {\n \"displayText\": \"Yes, I m Coming\"\n },\n \"type\": 1\n },\n {\n \"buttonId\": \"btn_no\",\n \"buttonText\": {\n \"displayText\": \"Sorry, Unable to attend\"\n },\n \"type\": 2\n }\n ]\n },\n \"delay\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.wachat.net/api/v1/send/button")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instanceName\": \"my-instance-01\",\n \"number\": \"628123456789\",\n \"type\": \"interactive\",\n \"interactive\": {\n \"type\": \"button\",\n \"title\": \"Confirm Attendance\",\n \"body\": \"Will you be attending the event tomorrow morning?\",\n \"footer\": \"Wachat\",\n \"buttons\": [\n {\n \"buttonId\": \"btn_yes\",\n \"buttonText\": {\n \"displayText\": \"Yes, I m Coming\"\n },\n \"type\": 1\n },\n {\n \"buttonId\": \"btn_no\",\n \"buttonText\": {\n \"displayText\": \"Sorry, Unable to attend\"\n },\n \"type\": 2\n }\n ]\n },\n \"delay\": 1000\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Authenticate your integration payloads by injecting your premium secure Wachat Account API Private Secret Key inside standard Authorization Bearer header vectors.
Body
application/json
The uniquely assigned name specifying your active cloud instance session.
Example:
"my-instance-01"
Target recipient international mobile number.
Example:
"628123456789"
Explicitly configure message grouping structure to interactive.
Available options:
interactive Example:
"interactive"
Show child attributes
Show child attributes
Fine-tune simulated organic system delay response limits in milliseconds.
Example:
123
Response
200
Quick reply components rendered and transmitted successfully.
⌘I
