Invia messaggi interattivi su WhatsApp
Impara a inviare messaggi con pulsanti e messaggi lista per creare esperienze di conversazione coinvolgenti su WhatsApp.
Prerequisiti
Canale WhatsApp connesso
Completa la guida configurazione WhatsApp Connetti WhatsApp Business API
Conversazione attiva
Entro finestra messaggistica 24 ore, OPPURE un template approvato
Chiave API (per uso API)
Genera in Impostazioni → Token API Settings → API Tokens
Finestra sessione 24 ore
Comprendere i messaggi interattivi
WhatsApp supporta due tipi di messaggi interattivi:
Messaggi con pulsanti
Pulsanti risposta rapida per scelte semplici. Fino a 3 pulsanti per messaggio.
- • Migliori per: Sì/No, Conferma/Cancella
- • Pulsanti max: 3
- • Titolo pulsante max: 20 caratteri
Messaggi lista
Menu espandibile con opzioni categorizzate. Fino a 10 elementi in sezioni.
- • Migliori per: Menu, cataloghi, scelta multipla
- • Sezioni max: 10
- • Righe totali max: 10
Metodo 1: Uso interfaccia dashboard
Apri una conversazione
Naviga su Conversazioni e apri una conversazione WhatsApp attiva. Assicurati che la conversazione sia entro la finestra 24 ore (vedrai un indicatore verde).
Clicca sul pulsante messaggio interattivo
Nel compositore messaggi, clicca sull'icona griglia (⊞) per aprire il costruttore messaggio interattivo. Questo apre un modulo dove puoi configurare il tuo messaggio.
Seleziona tipo messaggio
Scegli tra messaggio con pulsanti o messaggio lista. Il modulo si aggiornerà per mostrare i campi rilevanti per il tuo tipo selezionato.
Configura il tuo messaggio
Compila i dettagli messaggio:
- Intestazione (opzionale): Intestazione testo o immagine
- Corpo: Testo messaggio principale
- Footer (opzionale): Piccolo testo sotto il corpo
- Pulsanti/Elementi lista: Configura i tuoi elementi interattivi
Anteprima e invio
Rivedi l'anteprima sul lato destro del costruttore, quindi clicca Invia. Il messaggio verrà consegnato immediatamente al cliente.
Metodo 2: Uso API
Invio messaggi con pulsanti
I messaggi con pulsanti sono perfetti per scelte semplici come conferme:
const response = await fetch('https://api.sendseven.com/api/v1/messages/send/interactive', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
channel_id: 'channel_wa_001',
contact_id: 'contact_xyz789',
type: 'buttons',
body: 'Would you like to proceed with your order?',
buttons: [
{ id: 'confirm', title: 'Yes, confirm' },
{ id: 'cancel', title: 'No, cancel' }
]
})
});Mostra esempio Python
import requests
response = requests.post(
'https://api.sendseven.com/api/v1/messages/send/interactive',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'channel_id': 'channel_wa_001',
'contact_id': 'contact_xyz789',
'type': 'buttons',
'body': 'Would you like to proceed with your order?',
'buttons': [
{'id': 'confirm', 'title': 'Yes, confirm'},
{'id': 'cancel', 'title': 'No, cancel'}
]
}
)Mostra esempio cURL
curl -X POST 'https://api.sendseven.com/api/v1/messages/send/interactive' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"channel_id": "channel_wa_001",
"contact_id": "contact_xyz789",
"type": "buttons",
"body": "Would you like to proceed with your order?",
"buttons": [
{"id": "confirm", "title": "Yes, confirm"},
{"id": "cancel", "title": "No, cancel"}
]
}'Invio messaggi lista
I messaggi lista sono ideali per menu, cataloghi servizi o opzioni multiple:
const response = await fetch('https://api.sendseven.com/api/v1/messages/send/interactive', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
channel_id: 'channel_wa_001',
contact_id: 'contact_xyz789',
type: 'list',
header: { type: 'text', text: 'Select a Service' },
body: 'Choose from our available services:',
footer: 'Tap to see options',
button_text: 'View Services',
sections: [
{
title: 'Support',
rows: [
{ id: 'tech_support', title: 'Technical Support', description: 'Get help with technical issues' },
{ id: 'billing', title: 'Billing Inquiry', description: 'Questions about your bill' }
]
},
{
title: 'Sales',
rows: [
{ id: 'demo', title: 'Request Demo', description: 'Schedule a product demo' },
{ id: 'pricing', title: 'Get Pricing', description: 'Request a custom quote' }
]
}
]
})
});Mostra esempio Python
import requests
response = requests.post(
'https://api.sendseven.com/api/v1/messages/send/interactive',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'channel_id': 'channel_wa_001',
'contact_id': 'contact_xyz789',
'type': 'list',
'header': {'type': 'text', 'text': 'Select a Service'},
'body': 'Choose from our available services:',
'footer': 'Tap to see options',
'button_text': 'View Services',
'sections': [
{
'title': 'Support',
'rows': [
{'id': 'tech_support', 'title': 'Technical Support', 'description': 'Get help with technical issues'},
{'id': 'billing', 'title': 'Billing Inquiry', 'description': 'Questions about your bill'}
]
},
{
'title': 'Sales',
'rows': [
{'id': 'demo', 'title': 'Request Demo', 'description': 'Schedule a product demo'},
{'id': 'pricing', 'title': 'Get Pricing', 'description': 'Request a custom quote'}
]
}
]
}
)Gestione risposte utente
Quando un utente clicca un pulsante o seleziona un elemento lista, riceverai un evento webhook:
// message.received, data.message when a user taps a button
{
"message_type": "interactive",
"text": "Yes, confirm",
"attachments": [
{
"type": "button_reply",
"button_id": "confirm",
"button_title": "Yes, confirm"
}
],
"meta": {
"button": { "id": "confirm", "payload": "confirm", "text": "Yes, confirm" }
}
}
// message.received, data.message when a user selects a list item
{
"message_type": "interactive",
"text": "Technical Support\nGet help with technical issues",
"attachments": [
{
"type": "list_reply",
"list_id": "tech_support",
"list_title": "Technical Support",
"list_description": "Get help with technical issues"
}
],
"meta": {
"button": {
"id": "tech_support",
"payload": "tech_support",
"text": "Technical Support",
"list_title": "Technical Support",
"list_description": "Get help with technical issues"
}
}
}Gestione risposta
Risoluzione problemi
Errore "Sessione scaduta"▼
La finestra messaggistica 24 ore si è chiusa. Il cliente deve inviare prima un messaggio, o puoi usare un template messaggio per ri-coinvolgerlo.
I pulsanti non appaiono▼
Verifica che:
- I titoli pulsanti siano 20 caratteri o meno
- Abbi al massimo 3 pulsanti
- Ogni pulsante abbia un ID unico
- Il corpo messaggio non sia vuoto
La lista non si espande▼
Assicurati che button_text sia impostato. È l'etichetta del pulsante che apre la lista.
Passaggi successivi
Domande frequenti
Perché il mio messaggio interattivo non viene inviato?
Quanti pulsanti può avere un messaggio e quanto può essere lunga l'etichetta?
Posso inviare pulsanti e liste su canali diversi da WhatsApp?
I messaggi interattivi devono essere approvati da Meta?
I messaggi interattivi funzionano su un numero collegato tramite WhatsApp Coexistence?
Come faccio a sapere quale pulsante o elemento lista ha scelto il cliente?
Un Flow può inviare messaggi interattivi automaticamente?
Pronto per iniziare?
Inizia con 100 messaggi di prova. Accesso completo durante la prova. Nessuna carta di credito richiesta.