Mensajes de botones de respuesta interactivos
curl --request POST \
--url https://whatsapp.heybot.cloud/api/v2/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"type": "<string>",
"interactive": {
"type": "<string>",
"header": {
"type": "<string>",
"text": "<string>",
"[media_type]": {
"id": "<string>",
"link": "<string>"
}
},
"body": {
"text": "<string>"
},
"footer": {
"text": "<string>"
},
"action": {
"buttons": [
{
"type": "<string>",
"reply": {
"id": "<string>",
"title": "<string>"
}
}
]
}
}
}
'import requests
url = "https://whatsapp.heybot.cloud/api/v2/message"
payload = {
"to": "<string>",
"type": "<string>",
"interactive": {
"type": "<string>",
"header": {
"type": "<string>",
"text": "<string>",
"[media_type]": {
"id": "<string>",
"link": "<string>"
}
},
"body": { "text": "<string>" },
"footer": { "text": "<string>" },
"action": { "buttons": [
{
"type": "<string>",
"reply": {
"id": "<string>",
"title": "<string>"
}
}
] }
}
}
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({
to: '<string>',
type: '<string>',
interactive: {
type: '<string>',
header: {
type: '<string>',
text: '<string>',
'[media_type]': {id: '<string>', link: '<string>'}
},
body: JSON.stringify({text: '<string>'}),
footer: {text: '<string>'},
action: {buttons: [{type: '<string>', reply: {id: '<string>', title: '<string>'}}]}
}
})
};
fetch('https://whatsapp.heybot.cloud/api/v2/message', 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://whatsapp.heybot.cloud/api/v2/message",
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([
'to' => '<string>',
'type' => '<string>',
'interactive' => [
'type' => '<string>',
'header' => [
'type' => '<string>',
'text' => '<string>',
'[media_type]' => [
'id' => '<string>',
'link' => '<string>'
]
],
'body' => [
'text' => '<string>'
],
'footer' => [
'text' => '<string>'
],
'action' => [
'buttons' => [
[
'type' => '<string>',
'reply' => [
'id' => '<string>',
'title' => '<string>'
]
]
]
]
]
]),
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://whatsapp.heybot.cloud/api/v2/message"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"type\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"[media_type]\": {\n \"id\": \"<string>\",\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"footer\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\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://whatsapp.heybot.cloud/api/v2/message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"type\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"[media_type]\": {\n \"id\": \"<string>\",\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"footer\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whatsapp.heybot.cloud/api/v2/message")
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 \"to\": \"<string>\",\n \"type\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"[media_type]\": {\n \"id\": \"<string>\",\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"footer\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_bodyEnvío de mensajes
Mensajes de botones de respuesta interactivos
POST
/
api
/
v2
/
message
Mensajes de botones de respuesta interactivos
curl --request POST \
--url https://whatsapp.heybot.cloud/api/v2/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"type": "<string>",
"interactive": {
"type": "<string>",
"header": {
"type": "<string>",
"text": "<string>",
"[media_type]": {
"id": "<string>",
"link": "<string>"
}
},
"body": {
"text": "<string>"
},
"footer": {
"text": "<string>"
},
"action": {
"buttons": [
{
"type": "<string>",
"reply": {
"id": "<string>",
"title": "<string>"
}
}
]
}
}
}
'import requests
url = "https://whatsapp.heybot.cloud/api/v2/message"
payload = {
"to": "<string>",
"type": "<string>",
"interactive": {
"type": "<string>",
"header": {
"type": "<string>",
"text": "<string>",
"[media_type]": {
"id": "<string>",
"link": "<string>"
}
},
"body": { "text": "<string>" },
"footer": { "text": "<string>" },
"action": { "buttons": [
{
"type": "<string>",
"reply": {
"id": "<string>",
"title": "<string>"
}
}
] }
}
}
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({
to: '<string>',
type: '<string>',
interactive: {
type: '<string>',
header: {
type: '<string>',
text: '<string>',
'[media_type]': {id: '<string>', link: '<string>'}
},
body: JSON.stringify({text: '<string>'}),
footer: {text: '<string>'},
action: {buttons: [{type: '<string>', reply: {id: '<string>', title: '<string>'}}]}
}
})
};
fetch('https://whatsapp.heybot.cloud/api/v2/message', 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://whatsapp.heybot.cloud/api/v2/message",
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([
'to' => '<string>',
'type' => '<string>',
'interactive' => [
'type' => '<string>',
'header' => [
'type' => '<string>',
'text' => '<string>',
'[media_type]' => [
'id' => '<string>',
'link' => '<string>'
]
],
'body' => [
'text' => '<string>'
],
'footer' => [
'text' => '<string>'
],
'action' => [
'buttons' => [
[
'type' => '<string>',
'reply' => [
'id' => '<string>',
'title' => '<string>'
]
]
]
]
]
]),
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://whatsapp.heybot.cloud/api/v2/message"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"type\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"[media_type]\": {\n \"id\": \"<string>\",\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"footer\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\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://whatsapp.heybot.cloud/api/v2/message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"type\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"[media_type]\": {\n \"id\": \"<string>\",\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"footer\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whatsapp.heybot.cloud/api/v2/message")
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 \"to\": \"<string>\",\n \"type\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"text\": \"<string>\",\n \"[media_type]\": {\n \"id\": \"<string>\",\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"footer\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_bodyLos mensajes de botones de respuesta interactivos te permiten enviar hasta tres respuestas predefinidas que los usuarios deben seleccionar.
Para responder un mensaje, los usuarios pueden seleccionar uno de los botones predefinidos, lo que activa un webhook de mensajes que describe su selección.




string
required
The recipient’s phone number or WhatsApp ID.
string
default:"interactive"
required
The overall type of message being sent.
object
required
The interactive message payload configuration.
Hide interactive properties
Hide interactive properties
string
default:"button"
required
The specific type of interactive message you are sending.
object
Optional header content. Supports text or media (document, image, video).
Show header properties
Show header properties
string
required
The header type (e.g.,
text, image, document, video).string
The text content (required if header type is
text).object
required
The main content of the message.
Show body properties
Show body properties
string
required
The primary text content. URLs are automatically hyperlinked (Maximum 1024 characters).
object
Optional smaller text displayed beneath the main body.
Show footer properties
Show footer properties
string
The footer text content (Maximum 60 characters).
object
required
The configuration for the reply buttons.
Show action properties
Show action properties
array
required
An array defining the buttons attached to the message (maximum of 3 buttons).
Show button object
Show button object
string
default:"reply"
required
The type of button.
object
required
Ejemplo
MESSAGE_HEADER Opcional{
"type": "image|document|video",
"image": {
"link": "https://www.luckyshrub.com/media/workshop-banner.png"
}
}
{
"type": "text",
"text": "Workshop Details"
}
{
"to": 5219876543210,
"type": "interactive",
"interactive": {
"type": "button",
"header": {<MESSAGE_HEADER>},
"body": {
"text": "<BODY_TEXT>"
},
"footer": {
"text": "<FOOTER_TEXT>"
},
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "<BUTTON_ID>",
"title": "<BUTTON_LABEL_TEXT>"
}
}
<!-- Additional buttons would go here (maximum 3) -->
]
}
}
}