Caroselli multimediali WhatsApp
Invia da due a 10 card affiancate che si possono scorrere, ognuna con un'immagine o un video, un testo breve facoltativo e dei pulsanti.
Inviare un carosello
Imposta interactive.type su carousel, con un body_text a livello di messaggio e un array cards da 2 a 10 elementi:
const msg = await bird.whatsapp.send({
to: "+16505551234",
from: "+13124495648",
interactive: {
type: "carousel",
body_text: "Here are two of our latest arrivals, each under $25:",
cards: [
{
header: { type: "image", url: "https://cdn.example.com/plants/blue-echeveria.jpeg" },
buttons: [
{
type: "cta_url",
cta_url: { text: "Buy now", url: "https://shop.example.com/blue-echeveria" },
},
],
},
{
header: { type: "image", url: "https://cdn.example.com/plants/zebra-haworthia.jpeg" },
buttons: [
{
type: "cta_url",
cta_url: { text: "Buy now", url: "https://shop.example.com/zebra-haworthia" },
},
],
},
],
},
});
console.log(msg.id, msg.status);msg = client.whatsapp.send(
to="+16505551234",
from_="+13124495648",
interactive={
"type": "carousel",
"body_text": "Here are two of our latest arrivals, each under $25:",
"cards": [
{
"header": {"type": "image", "url": "https://cdn.example.com/plants/blue-echeveria.jpeg"},
"buttons": [{"type": "cta_url", "cta_url": {"text": "Buy now", "url": "https://shop.example.com/blue-echeveria"}}],
},
{
"header": {"type": "image", "url": "https://cdn.example.com/plants/zebra-haworthia.jpeg"},
"buttons": [{"type": "cta_url", "cta_url": {"text": "Buy now", "url": "https://shop.example.com/zebra-haworthia"}}],
},
],
},
)
print(msg.id, msg.status)msg, err := client.Whatsapp.Send(context.Background(), bird.WhatsappSendParams{
To: "+16505551234",
From: "+13124495648",
Interactive: &bird.WhatsAppInteractiveSend{
Type: "carousel",
BodyText: "Here are two of our latest arrivals, each under $25:",
Cards: &[]bird.WhatsAppInteractiveCardSend{
{
Header: bird.WhatsAppInteractiveCardHeaderSend{
Type: "image",
Url: "https://cdn.example.com/plants/blue-echeveria.jpeg",
},
Buttons: []bird.WhatsAppInteractiveButtonSend{{
Type: "cta_url",
CtaUrl: &bird.WhatsAppInteractiveCtaUrlSend{
Text: "Buy now",
Url: "https://shop.example.com/blue-echeveria",
},
}},
},
{
Header: bird.WhatsAppInteractiveCardHeaderSend{
Type: "image",
Url: "https://cdn.example.com/plants/zebra-haworthia.jpeg",
},
Buttons: []bird.WhatsAppInteractiveButtonSend{{
Type: "cta_url",
CtaUrl: &bird.WhatsAppInteractiveCtaUrlSend{
Text: "Buy now",
Url: "https://shop.example.com/zebra-haworthia",
},
}},
},
},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(msg.Id, *msg.Status)$interactive = (new WhatsAppMessageSendRequestInteractive())
->setType('carousel')
->setBodyText('Here are two of our latest arrivals, each under $25:')
->setCards([
(new WhatsAppInteractiveCardSend())
->setHeader((new WhatsAppInteractiveCardSendHeader())->setType('image')->setUrl('https://cdn.example.com/plants/blue-echeveria.jpeg'))
->setButtons([
(new WhatsAppInteractiveButtonSend())
->setType('cta_url')
->setCtaUrl((new WhatsAppInteractiveButtonSendCtaUrl())->setText('Buy now')->setUrl('https://shop.example.com/blue-echeveria')),
]),
(new WhatsAppInteractiveCardSend())
->setHeader((new WhatsAppInteractiveCardSendHeader())->setType('image')->setUrl('https://cdn.example.com/plants/zebra-haworthia.jpeg'))
->setButtons([
(new WhatsAppInteractiveButtonSend())
->setType('cta_url')
->setCtaUrl((new WhatsAppInteractiveButtonSendCtaUrl())->setText('Buy now')->setUrl('https://shop.example.com/zebra-haworthia')),
]),
]);
$message = $bird->whatsapp->send(
to: '+16505551234',
from: '+13124495648',
interactive: $interactive,
);
echo $message->getId(), ' ', $message->getStatus();bird whatsapp send \
--from +13124495648 \
--interactive '{"body_text":"Here are two of our latest arrivals, each under $25:","cards":[{"buttons":[{"cta_url":{"text":"Buy now","url":"https://shop.example.com/blue-echeveria"},"type":"cta_url"}],"header":{"type":"image","url":"https://cdn.example.com/plants/blue-echeveria.jpeg"}},{"buttons":[{"cta_url":{"text":"Buy now","url":"https://shop.example.com/zebra-haworthia"},"type":"cta_url"}],"header":{"type":"image","url":"https://cdn.example.com/plants/zebra-haworthia.jpeg"}}],"type":"carousel"}' \
--to +16505551234curl -X POST "https://{region}.platform.bird.com/v1/whatsapp/messages" \
-H "Authorization: Bearer $BIRD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+16505551234",
"from": "+13124495648",
"interactive": {
"type": "carousel",
"body_text": "Here are two of our latest arrivals, each under $25:",
"cards": [
{
"header": { "type": "image", "url": "https://cdn.example.com/plants/blue-echeveria.jpeg" },
"buttons": [{ "type": "cta_url", "cta_url": { "text": "Buy now", "url": "https://shop.example.com/blue-echeveria" } }]
},
{
"header": { "type": "image", "url": "https://cdn.example.com/plants/zebra-haworthia.jpeg" },
"buttons": [{ "type": "cta_url", "cta_url": { "text": "Buy now", "url": "https://shop.example.com/zebra-haworthia" } }]
}
]
}
}'La struttura completa aggiunge il testo del corpo della card, pulsanti di risposta rapida e una citazione facoltativa (in_reply_to_message_id):
{
"to": "+16505551234",
"from": "+13124495648",
"in_reply_to_message_id": "wam_01kya19eknftrs2s6p82asmvnh",
"interactive": {
"type": "carousel",
"body_text": "Here are two of our latest arrivals, each under $25:",
"cards": [
{
"header": { "type": "image", "url": "https://cdn.example.com/plants/blue-echeveria.jpeg" },
"body_text": "Blue Echeveria. Powdery blue leaves.",
"buttons": [
{ "type": "quick_reply", "quick_reply": { "slug": "buy-echeveria", "text": "Buy" } },
{ "type": "quick_reply", "quick_reply": { "slug": "info-echeveria", "text": "Details" } }
]
},
{
"header": { "type": "image", "url": "https://cdn.example.com/plants/zebra-haworthia.jpeg" },
"body_text": "Zebra Haworthia. White stripes on deep green leaves.",
"buttons": [
{ "type": "quick_reply", "quick_reply": { "slug": "buy-haworthia", "text": "Buy" } },
{ "type": "quick_reply", "quick_reply": { "slug": "info-haworthia", "text": "Details" } }
]
}
]
},
"tags": [{ "name": "category", "value": "catalog" }],
"metadata": { "order_id": "A-1" }
}Card
Le card vengono visualizzate da sinistra a destra nell'ordine dell'array, senza header o footer a livello di messaggio:
header(obbligatorio): solo URLimageovideo.body_text(facoltativo): fino a 160 caratteri e al massimo due interruzioni di riga.buttons(obbligatorio): un pulsantecta_urloppure da uno a tre pulsantiquick_reply(mai combinati sulla stessa card).
Pulsanti uniformi nelle card
Ogni card di un carosello deve dichiarare gli stessi tipi di pulsante, lo stesso numero di pulsanti e lo stesso ordine. Le card non corrispondenti falliscono prima dell'addebito con E15059.
L'univocità delle etichette dei pulsanti viene verificata per ogni card: ripetere "Buy now" su card diverse è valido, mentre ripetere un'etichetta sulla stessa card fallisce con E15056.
Limiti
| Campo | Vincolo |
|---|---|
cards | Da 2 a 10 card |
header della card | Obbligatorio (URL image o video) |
body_text della card | Fino a 160 caratteri, massimo 2 interruzioni di riga |
buttons della card | 1 cta_url oppure da 1 a 3 quick_reply |
body_text del messaggio | Da 1 a 1.024 caratteri (nessun header o footer del messaggio) |
Per i limiti di caratteri delle etichette dei pulsanti, di slug e degli URL, consulta Creare un messaggio WhatsApp.
Leggere la risposta
Solo i pulsanti quick_reply delle card producono una risposta in entrata. Quando un destinatario ne tocca uno, la risposta arriva come messaggio in entrata separato contenente interactive_reply:
{
"id": "wam_01kyb2m4xq7whs0d8n3prv6tez",
"direction": "inbound",
"from": { "phone_number": "+16505551234" },
"to": { "phone_number": "+13124495648" },
"status": "received",
"in_reply_to_message_id": "wam_01kya19eknftrs2s6p82asmvnh",
"interactive_reply": {
"type": "button",
"button": {
"slug": "buy-echeveria",
"text": "Buy"
}
},
"created_at": "2026-08-25T09:04:11Z"
}Il slug impostato sul pulsante toccato torna invariato in interactive_reply.button.slug, con lo stesso formato del tap su un pulsante di risposta. Leggi questa risposta tramite l'elenco dei messaggi o GET /v1/whatsapp/messages/{id}. Per i dettagli, consulta leggere una risposta.
Un pulsante cta_url su una card apre il suo link senza generare una risposta in entrata, come un pulsante link autonomo.
Caroselli liberi e caroselli template
I caroselli liberi vengono consegnati all'interno di una finestra di assistenza clienti aperta, con un numero qualsiasi di card da due a 10, e non richiedono la revisione di Meta. Per inviare un carosello al di fuori della finestra di assistenza, crea un template carosello, che fissa il numero di card al momento dell'approvazione.
Limiti e casi particolari
- Nessun indice della card nelle risposte: un tap su
quick_replyrestituisce solo{ slug, text }, quindi, se devi distinguere le card, codifica la card nelslugdi ogni pulsante (ad esempiobuy-echeveria). - Il contenuto multimediale delle card viene recuperato in modo asincrono: usa URL HTTPS pubblici. Gli URI malformati (ad esempio un percorso relativo) non superano subito la validazione della richiesta e non vengono addebitati, mentre gli URL ben formati ma non raggiungibili, scaduti o
http://falliscono dopo l'accettazione conmedia_rejectede vengono comunque addebitati. - Regole comuni: è necessaria una finestra di assistenza clienti aperta e un numero
fromdi proprietà dello spazio di lavoro. Consulta errori interattivi e Invio di messaggi WhatsApp.
Prossimi passi
- Messaggi interattivi WhatsApp: cosa condividono tutti e sei i tipi interattivi
- Template WhatsApp: per un carosello da inviare al di fuori della finestra di assistenza clienti
- Invio di messaggi WhatsApp: la struttura della richiesta, il modello
202e i nuovi tentativi sicuri
Risorse correlate
Continua con la documentazione, le guide e gli esempi per questo argomento.