Enviar botões (mensagem interativa) (Send buttons (interactive message))
curl --request POST \
--url https://{host}/api/sendButtons \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us",
"header": "How are you?",
"body": "Tell us how are you please 🙏",
"footer": "If you have any questions, please send it in the chat",
"buttons": [
{
"type": "reply",
"text": "I am good!"
},
{
"type": "call",
"text": "Call us",
"phoneNumber": "+1234567890"
},
{
"type": "copy",
"text": "Copy code",
"copyCode": "4321"
},
{
"type": "url",
"text": "How did you do that?",
"url": "https://wappfy.com.br"
}
],
"session": "my-session",
"headerImage": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
'import requests
url = "https://{host}/api/sendButtons"
payload = {
"chatId": "5511999999999@c.us",
"header": "How are you?",
"body": "Tell us how are you please 🙏",
"footer": "If you have any questions, please send it in the chat",
"buttons": [
{
"type": "reply",
"text": "I am good!"
},
{
"type": "call",
"text": "Call us",
"phoneNumber": "+1234567890"
},
{
"type": "copy",
"text": "Copy code",
"copyCode": "4321"
},
{
"type": "url",
"text": "How did you do that?",
"url": "https://wappfy.com.br"
}
],
"session": "my-session",
"headerImage": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
header: 'How are you?',
body: JSON.stringify('Tell us how are you please 🙏'),
footer: 'If you have any questions, please send it in the chat',
buttons: [
{type: 'reply', text: 'I am good!'},
{type: 'call', text: 'Call us', phoneNumber: '+1234567890'},
{type: 'copy', text: 'Copy code', copyCode: '4321'},
{type: 'url', text: 'How did you do that?', url: 'https://wappfy.com.br'}
],
session: 'my-session',
headerImage: {
mimetype: 'image/jpeg',
url: 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
filename: 'filename.jpg'
}
})
};
fetch('https://{host}/api/sendButtons', 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://{host}/api/sendButtons",
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([
'chatId' => '5511999999999@c.us',
'header' => 'How are you?',
'body' => 'Tell us how are you please 🙏',
'footer' => 'If you have any questions, please send it in the chat',
'buttons' => [
[
'type' => 'reply',
'text' => 'I am good!'
],
[
'type' => 'call',
'text' => 'Call us',
'phoneNumber' => '+1234567890'
],
[
'type' => 'copy',
'text' => 'Copy code',
'copyCode' => '4321'
],
[
'type' => 'url',
'text' => 'How did you do that?',
'url' => 'https://wappfy.com.br'
]
],
'session' => 'my-session',
'headerImage' => [
'mimetype' => 'image/jpeg',
'url' => 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
'filename' => 'filename.jpg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/sendButtons"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"header\": \"How are you?\",\n \"body\": \"Tell us how are you please 🙏\",\n \"footer\": \"If you have any questions, please send it in the chat\",\n \"buttons\": [\n {\n \"type\": \"reply\",\n \"text\": \"I am good!\"\n },\n {\n \"type\": \"call\",\n \"text\": \"Call us\",\n \"phoneNumber\": \"+1234567890\"\n },\n {\n \"type\": \"copy\",\n \"text\": \"Copy code\",\n \"copyCode\": \"4321\"\n },\n {\n \"type\": \"url\",\n \"text\": \"How did you do that?\",\n \"url\": \"https://wappfy.com.br\"\n }\n ],\n \"session\": \"my-session\",\n \"headerImage\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/sendButtons")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"header\": \"How are you?\",\n \"body\": \"Tell us how are you please 🙏\",\n \"footer\": \"If you have any questions, please send it in the chat\",\n \"buttons\": [\n {\n \"type\": \"reply\",\n \"text\": \"I am good!\"\n },\n {\n \"type\": \"call\",\n \"text\": \"Call us\",\n \"phoneNumber\": \"+1234567890\"\n },\n {\n \"type\": \"copy\",\n \"text\": \"Copy code\",\n \"copyCode\": \"4321\"\n },\n {\n \"type\": \"url\",\n \"text\": \"How did you do that?\",\n \"url\": \"https://wappfy.com.br\"\n }\n ],\n \"session\": \"my-session\",\n \"headerImage\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sendButtons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"header\": \"How are you?\",\n \"body\": \"Tell us how are you please 🙏\",\n \"footer\": \"If you have any questions, please send it in the chat\",\n \"buttons\": [\n {\n \"type\": \"reply\",\n \"text\": \"I am good!\"\n },\n {\n \"type\": \"call\",\n \"text\": \"Call us\",\n \"phoneNumber\": \"+1234567890\"\n },\n {\n \"type\": \"copy\",\n \"text\": \"Copy code\",\n \"copyCode\": \"4321\"\n },\n {\n \"type\": \"url\",\n \"text\": \"How did you do that?\",\n \"url\": \"https://wappfy.com.br\"\n }\n ],\n \"session\": \"my-session\",\n \"headerImage\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Mensagens
Enviar Botões (Lista)
Enviar mensagem interativa com botões de lista
POST
/
api
/
sendButtons
Enviar botões (mensagem interativa) (Send buttons (interactive message))
curl --request POST \
--url https://{host}/api/sendButtons \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us",
"header": "How are you?",
"body": "Tell us how are you please 🙏",
"footer": "If you have any questions, please send it in the chat",
"buttons": [
{
"type": "reply",
"text": "I am good!"
},
{
"type": "call",
"text": "Call us",
"phoneNumber": "+1234567890"
},
{
"type": "copy",
"text": "Copy code",
"copyCode": "4321"
},
{
"type": "url",
"text": "How did you do that?",
"url": "https://wappfy.com.br"
}
],
"session": "my-session",
"headerImage": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
'import requests
url = "https://{host}/api/sendButtons"
payload = {
"chatId": "5511999999999@c.us",
"header": "How are you?",
"body": "Tell us how are you please 🙏",
"footer": "If you have any questions, please send it in the chat",
"buttons": [
{
"type": "reply",
"text": "I am good!"
},
{
"type": "call",
"text": "Call us",
"phoneNumber": "+1234567890"
},
{
"type": "copy",
"text": "Copy code",
"copyCode": "4321"
},
{
"type": "url",
"text": "How did you do that?",
"url": "https://wappfy.com.br"
}
],
"session": "my-session",
"headerImage": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
header: 'How are you?',
body: JSON.stringify('Tell us how are you please 🙏'),
footer: 'If you have any questions, please send it in the chat',
buttons: [
{type: 'reply', text: 'I am good!'},
{type: 'call', text: 'Call us', phoneNumber: '+1234567890'},
{type: 'copy', text: 'Copy code', copyCode: '4321'},
{type: 'url', text: 'How did you do that?', url: 'https://wappfy.com.br'}
],
session: 'my-session',
headerImage: {
mimetype: 'image/jpeg',
url: 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
filename: 'filename.jpg'
}
})
};
fetch('https://{host}/api/sendButtons', 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://{host}/api/sendButtons",
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([
'chatId' => '5511999999999@c.us',
'header' => 'How are you?',
'body' => 'Tell us how are you please 🙏',
'footer' => 'If you have any questions, please send it in the chat',
'buttons' => [
[
'type' => 'reply',
'text' => 'I am good!'
],
[
'type' => 'call',
'text' => 'Call us',
'phoneNumber' => '+1234567890'
],
[
'type' => 'copy',
'text' => 'Copy code',
'copyCode' => '4321'
],
[
'type' => 'url',
'text' => 'How did you do that?',
'url' => 'https://wappfy.com.br'
]
],
'session' => 'my-session',
'headerImage' => [
'mimetype' => 'image/jpeg',
'url' => 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
'filename' => 'filename.jpg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/sendButtons"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"header\": \"How are you?\",\n \"body\": \"Tell us how are you please 🙏\",\n \"footer\": \"If you have any questions, please send it in the chat\",\n \"buttons\": [\n {\n \"type\": \"reply\",\n \"text\": \"I am good!\"\n },\n {\n \"type\": \"call\",\n \"text\": \"Call us\",\n \"phoneNumber\": \"+1234567890\"\n },\n {\n \"type\": \"copy\",\n \"text\": \"Copy code\",\n \"copyCode\": \"4321\"\n },\n {\n \"type\": \"url\",\n \"text\": \"How did you do that?\",\n \"url\": \"https://wappfy.com.br\"\n }\n ],\n \"session\": \"my-session\",\n \"headerImage\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/sendButtons")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"header\": \"How are you?\",\n \"body\": \"Tell us how are you please 🙏\",\n \"footer\": \"If you have any questions, please send it in the chat\",\n \"buttons\": [\n {\n \"type\": \"reply\",\n \"text\": \"I am good!\"\n },\n {\n \"type\": \"call\",\n \"text\": \"Call us\",\n \"phoneNumber\": \"+1234567890\"\n },\n {\n \"type\": \"copy\",\n \"text\": \"Copy code\",\n \"copyCode\": \"4321\"\n },\n {\n \"type\": \"url\",\n \"text\": \"How did you do that?\",\n \"url\": \"https://wappfy.com.br\"\n }\n ],\n \"session\": \"my-session\",\n \"headerImage\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sendButtons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"header\": \"How are you?\",\n \"body\": \"Tell us how are you please 🙏\",\n \"footer\": \"If you have any questions, please send it in the chat\",\n \"buttons\": [\n {\n \"type\": \"reply\",\n \"text\": \"I am good!\"\n },\n {\n \"type\": \"call\",\n \"text\": \"Call us\",\n \"phoneNumber\": \"+1234567890\"\n },\n {\n \"type\": \"copy\",\n \"text\": \"Copy code\",\n \"copyCode\": \"4321\"\n },\n {\n \"type\": \"url\",\n \"text\": \"How did you do that?\",\n \"url\": \"https://wappfy.com.br\"\n }\n ],\n \"session\": \"my-session\",\n \"headerImage\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Descrição
Este endpoint permite enviar mensagens interativas com botões organizados em listas para contatos individuais ou grupos no WhatsApp. As listas podem conter múltiplas seções com várias opções cada.Body
{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"list": {
"title": "Menu de Opções",
"description": "Selecione uma das opções abaixo",
"button": "Ver Opções",
"sections": [
{
"title": "Produtos",
"rows": [
{
"title": "Plano Basic",
"description": "R$ 29,90/mês",
"rowId": "plan_basic"
}
]
}
]
}
}
Parâmetros do Body
| Propriedade | Tipo | Obrigatório | Descrição |
|---|---|---|---|
sessionId | string | ✅ Sim | ID da sessão autenticada que enviará a mensagem |
jid | string | ✅ Sim | Identificador do destinatário (JID do WhatsApp). Formato: 5511999999999@s.whatsapp.net para contatos ou 120363XXXXX@g.us para grupos |
list | object | ✅ Sim | Objeto contendo as informações da lista de botões |
list.title | string | ✅ Sim | Título da mensagem |
list.description | string | ❌ Não | Descrição ou corpo da mensagem |
list.button | string | ✅ Sim | Texto do botão que abre a lista (exemplo: “Ver opções”) |
list.sections | array | ✅ Sim | Array de seções da lista |
list.sections[].title | string | ✅ Sim | Título da seção |
list.sections[].rows | array | ✅ Sim | Array de linhas (opções) da seção |
list.sections[].rows[].title | string | ✅ Sim | Título da opção |
list.sections[].rows[].description | string | ❌ Não | Descrição da opção |
list.sections[].rows[].rowId | string | ✅ Sim | ID único da opção (usado para identificar a resposta) |
{
"success": true,
"messageId": "3EB0XXXXXX"
}
Códigos de Status
200- Mensagem com botões enviada com sucesso400- Parâmetros inválidos401- Sessão não autorizada404- Sessão não encontrada
Exemplo de Uso
curl -X POST https://api.wappfy.com.br/api/sendButtons \
-H "Content-Type: application/json" \
-d '{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"list": {
"title": "Menu de Opções",
"description": "Selecione uma das opções abaixo:",
"button": "Ver Menu",
"sections": [
{
"title": "Produtos",
"rows": [
{
"title": "Plano Basic",
"description": "R$ 29,90/mês",
"rowId": "plan_basic"
},
{
"title": "Plano Pro",
"description": "R$ 59,90/mês",
"rowId": "plan_pro"
}
]
},
{
"title": "Suporte",
"rows": [
{
"title": "Falar com atendente",
"rowId": "support_human"
}
]
}
]
}
}'
const response = await fetch('https://api.wappfy.com.br/api/sendButtons', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
sessionId: 'my-session',
jid: '5511999999999@s.whatsapp.net',
list: {
title: 'Menu de Opções',
description: 'Selecione uma das opções abaixo:',
button: 'Ver Menu',
sections: [
{
title: 'Produtos',
rows: [
{
title: 'Plano Basic',
description: 'R$ 29,90/mês',
rowId: 'plan_basic'
},
{
title: 'Plano Pro',
description: 'R$ 59,90/mês',
rowId: 'plan_pro'
}
]
},
{
title: 'Suporte',
rows: [
{
title: 'Falar com atendente',
rowId: 'support_human'
}
]
}
]
}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.wappfy.com.br/api/sendButtons',
json={
'sessionId': 'my-session',
'jid': '5511999999999@s.whatsapp.net',
'list': {
'title': 'Menu de Opções',
'description': 'Selecione uma das opções abaixo:',
'button': 'Ver Menu',
'sections': [
{
'title': 'Produtos',
'rows': [
{
'title': 'Plano Basic',
'description': 'R$ 29,90/mês',
'rowId': 'plan_basic'
},
{
'title': 'Plano Pro',
'description': 'R$ 59,90/mês',
'rowId': 'plan_pro'
}
]
},
{
'title': 'Suporte',
'rows': [
{
'title': 'Falar com atendente',
'rowId': 'support_human'
}
]
}
]
}
}
)
data = response.json()
print(data)
Authorizations
Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)
Body
application/json
Example:
"5511999999999@c.us"
Example:
"How are you?"
Example:
"Tell us how are you please 🙏"
Example:
"If you have any questions, please send it in the chat"
Show child attributes
Show child attributes
Example:
[
{ "type": "reply", "text": "I am good!" },
{
"type": "call",
"text": "Call us",
"phoneNumber": "+1234567890"
},
{
"type": "copy",
"text": "Copy code",
"copyCode": "4321"
},
{
"type": "url",
"text": "How did you do that?",
"url": "https://wappfy.com.br"
}
]
Nome da sessão (instanceName)
Example:
"my-session"
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
201 - undefined
⌘I
