Mensaje con carrusel interactivo
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>",
"body": {
"text": "<string>"
},
"action": {
"cards": [
{
"card_index": 123,
"type": "<string>",
"header": {
"type": "<string>",
"[media_type]": {
"link": "<string>"
}
},
"body": {
"text": "<string>"
},
"action": {
"name": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>"
},
"buttons": [
{
"type": "<string>",
"quick_reply": {
"id": "<string>",
"title": "<string>"
}
}
]
}
}
]
}
}
}
'import requests
url = "https://whatsapp.heybot.cloud/api/v2/message"
payload = {
"to": "<string>",
"type": "<string>",
"interactive": {
"type": "<string>",
"body": { "text": "<string>" },
"action": { "cards": [
{
"card_index": 123,
"type": "<string>",
"header": {
"type": "<string>",
"[media_type]": { "link": "<string>" }
},
"body": { "text": "<string>" },
"action": {
"name": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>"
},
"buttons": [
{
"type": "<string>",
"quick_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>',
body: JSON.stringify({text: '<string>'}),
action: {
cards: [
{
card_index: 123,
type: '<string>',
header: {type: '<string>', '[media_type]': {link: '<string>'}},
body: JSON.stringify({text: '<string>'}),
action: {
name: '<string>',
parameters: {display_text: '<string>', url: '<string>'},
buttons: [{type: '<string>', quick_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>',
'body' => [
'text' => '<string>'
],
'action' => [
'cards' => [
[
'card_index' => 123,
'type' => '<string>',
'header' => [
'type' => '<string>',
'[media_type]' => [
'link' => '<string>'
]
],
'body' => [
'text' => '<string>'
],
'action' => [
'name' => '<string>',
'parameters' => [
'display_text' => '<string>',
'url' => '<string>'
],
'buttons' => [
[
'type' => '<string>',
'quick_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 \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"cards\": [\n {\n \"card_index\": 123,\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"[media_type]\": {\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"name\": \"<string>\",\n \"parameters\": {\n \"display_text\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"quick_reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\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 \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"cards\": [\n {\n \"card_index\": 123,\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"[media_type]\": {\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"name\": \"<string>\",\n \"parameters\": {\n \"display_text\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"quick_reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\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 \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"cards\": [\n {\n \"card_index\": 123,\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"[media_type]\": {\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"name\": \"<string>\",\n \"parameters\": {\n \"display_text\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"quick_reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_bodyEnvío de mensajes
Mensaje con carrusel interactivo
POST
/
api
/
v2
/
message
Mensaje con carrusel interactivo
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>",
"body": {
"text": "<string>"
},
"action": {
"cards": [
{
"card_index": 123,
"type": "<string>",
"header": {
"type": "<string>",
"[media_type]": {
"link": "<string>"
}
},
"body": {
"text": "<string>"
},
"action": {
"name": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>"
},
"buttons": [
{
"type": "<string>",
"quick_reply": {
"id": "<string>",
"title": "<string>"
}
}
]
}
}
]
}
}
}
'import requests
url = "https://whatsapp.heybot.cloud/api/v2/message"
payload = {
"to": "<string>",
"type": "<string>",
"interactive": {
"type": "<string>",
"body": { "text": "<string>" },
"action": { "cards": [
{
"card_index": 123,
"type": "<string>",
"header": {
"type": "<string>",
"[media_type]": { "link": "<string>" }
},
"body": { "text": "<string>" },
"action": {
"name": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>"
},
"buttons": [
{
"type": "<string>",
"quick_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>',
body: JSON.stringify({text: '<string>'}),
action: {
cards: [
{
card_index: 123,
type: '<string>',
header: {type: '<string>', '[media_type]': {link: '<string>'}},
body: JSON.stringify({text: '<string>'}),
action: {
name: '<string>',
parameters: {display_text: '<string>', url: '<string>'},
buttons: [{type: '<string>', quick_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>',
'body' => [
'text' => '<string>'
],
'action' => [
'cards' => [
[
'card_index' => 123,
'type' => '<string>',
'header' => [
'type' => '<string>',
'[media_type]' => [
'link' => '<string>'
]
],
'body' => [
'text' => '<string>'
],
'action' => [
'name' => '<string>',
'parameters' => [
'display_text' => '<string>',
'url' => '<string>'
],
'buttons' => [
[
'type' => '<string>',
'quick_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 \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"cards\": [\n {\n \"card_index\": 123,\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"[media_type]\": {\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"name\": \"<string>\",\n \"parameters\": {\n \"display_text\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"quick_reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\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 \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"cards\": [\n {\n \"card_index\": 123,\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"[media_type]\": {\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"name\": \"<string>\",\n \"parameters\": {\n \"display_text\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"quick_reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\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 \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"cards\": [\n {\n \"card_index\": 123,\n \"type\": \"<string>\",\n \"header\": {\n \"type\": \"<string>\",\n \"[media_type]\": {\n \"link\": \"<string>\"\n }\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"action\": {\n \"name\": \"<string>\",\n \"parameters\": {\n \"display_text\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"quick_reply\": {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n }\n ]\n }\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_bodyLos mensajes por secuencia con contenido multimedia interactivo muestran un conjunto de tarjetas de contenido multimedia que se pueden desplazar horizontalmente. Cada tarjeta puede mostrar un encabezado de imagen o video, un texto y botones de respuesta rápida o un botón de URL.


- Los mensajes deben incluir entre 2 y 10 tarjetas.
- Se requiere el texto del cuerpo del mensaje principal.
- No se admiten encabezados, pies ni componentes interactivos de mensajes principales.
- Las tarjetas deben incluir un encabezado de imagen o video. No se admiten otros tipos de encabezados.
- El texto del cuerpo de la tarjeta es opcional.
- Las tarjetas deben incluir un botón de URL o uno o más botones de respuesta rápida. Los tipos y números de botones deben coincidir en todas las tarjetas (por ejemplo, si defines una tarjeta con dos botones de respuesta rápida, todas las tarjetas deben definir exactamente dos botones de respuesta rápida).


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:"carousel"
required
The specific type of interactive message you are sending.
object
required
The main content of the message.
Show body properties
Show body properties
string
required
The primary text content that appears above the carousel.
object
required
The configuration for the carousel cards.
Show action properties
Show action properties
array
required
An array defining the individual cards in the carousel (max 10).
Show card object
Show card object
integer
The zero-based index of the card.
string
required
The card component type.
object
required
object
Optional text displayed below the header media.
Show body properties
Show body properties
string
The card’s main description text.
object
required
The button interactions attached to this specific card.
Show card action properties
Show card action properties
string
Required if using a URL button (set to
cta_url).object
array
Configuration if using one or more quick-reply buttons.
Ejemplo
{
"to": 5219876543210,
"type": "interactive",
"interactive": {
"type": "carousel",
"body": {
"text": "<MESSAGE_BODY_TEXT>"
},
"action": {
<!-- First card object -->
"cards": [
{
"card_index": <CARD_INDEX>,
"type": "cta_url",
"header": {
"type": "<HEADER_TYPE>",
"<HEADER_TYPE>": {
"link": "<MEDIA_ASSET_URL>"
}
},
<!-- Card body text is optional -->
"body": {
"text": "<CARD_BODY_TEXT>"
},
"action": {
<!-- Only if using a URL button -->
"name": "cta_url",
"parameters": {
"display_text": "<URL_BUTTON_LABEL>",
"url": "<URL_BUTTON_URL>"
}
<!-- Only if using one or more quick-reply buttons -->
"buttons": [
{
"type": "quick_reply",
"quick_reply": {
"id": "<QUICK_REPLY_BUTTON_ID>",
"title": "<QUICK_REPLY_BUTTON_LABEL>"
}
},
<!-- Additional quick-reply buttons would follow -->
}
},
<!-- Additional card objects would follow -->
]
}
}
}