curl --request POST \
--url https://api.omni.z-api.io/channels/{channel_id}/token/{channel_token}/send-button-actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "5511999999999",
"message": "Hello! How can we help?",
"title": "Omni Z-API",
"footer": "Choose an option",
"buttonActions": [
{
"id": "1",
"type": "CALL",
"phone": "5511999999999",
"label": "Contact us"
},
{
"id": "2",
"type": "URL",
"url": "https://www.omni.z-api.io",
"label": "Visit our website"
}
]
}
'{
"zaapId": "3999984263738042930CD6ECDE9VDWSA",
"messageId": "D241XXXX732339502B68",
"id": "D241XXXX732339502B68"
}{
"error": 405,
"message": "Method not allowed"
}{
"error": 415,
"message": "Unsupported media type"
}Mensagens
Enviar botões de ação
Envie mensagens com botões de ação (ligar, URL, resposta rápida)
POST
/
send-button-actions
curl --request POST \
--url https://api.omni.z-api.io/channels/{channel_id}/token/{channel_token}/send-button-actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "5511999999999",
"message": "Hello! How can we help?",
"title": "Omni Z-API",
"footer": "Choose an option",
"buttonActions": [
{
"id": "1",
"type": "CALL",
"phone": "5511999999999",
"label": "Contact us"
},
{
"id": "2",
"type": "URL",
"url": "https://www.omni.z-api.io",
"label": "Visit our website"
}
]
}
'{
"zaapId": "3999984263738042930CD6ECDE9VDWSA",
"messageId": "D241XXXX732339502B68",
"id": "D241XXXX732339502B68"
}{
"error": 405,
"message": "Method not allowed"
}{
"error": 415,
"message": "Unsupported media type"
}Conceituação
Método para envio de mensagens com botões de ação. Existem três tipos de botão:- CALL — Botão para ligar para um número
- URL — Botão para abrir um link
- REPLY — Botão de resposta rápida
Não combine os três tipos de botão na mesma mensagem. Envie botões de CALL + URL juntos, e botões de REPLY separadamente. Combinar todos causa erro no WhatsApp Web.
Para botões de copiar código, use o formato de URL:
https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code=SEU_CODIGOAutorizações
Secret Key generated in the Omni Z-API Security panel
Corpo
application/json
Recipient phone number (country code + area code + number)
Exemplo:
"5511999999999"
Message text
List of action buttons
Show child attributes
Show child attributes
Message title
Message footer
Delay in seconds before sending (1-15)
Intervalo obrigatório:
1 <= x <= 15