curl --request POST \
--url https://api.omni.z-api.io/v1/channels/{channelId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipient": {
"identifier": "5511999999999"
},
"content": {
"type": "INTERACTIVE_ACTION",
"body": {
"message": "Como podemos ajudar?"
},
"header": {
"message": "Omni Z-API"
},
"footer": {
"message": "Escolha uma opção"
},
"attachments": [
{
"id": "1",
"title": "Visite nosso site",
"name": "URL",
"url": "https://www.omni.z-api.io"
},
{
"id": "2",
"title": "Fale conosco",
"name": "CALL",
"phones": [
"5511999999999"
]
}
]
}
}
'{
"messageId": "wamid.HBgNNTU0NDk3MDUwNzg1FQIAERgSM0"
}{
"error": 401,
"message": "Unauthorized"
}Mensagens
Enviar botões de ação
Envie mensagens com botões de ação (URL e ligar)
POST
/
v1
/
channels
/
{channelId}
/
messages
curl --request POST \
--url https://api.omni.z-api.io/v1/channels/{channelId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipient": {
"identifier": "5511999999999"
},
"content": {
"type": "INTERACTIVE_ACTION",
"body": {
"message": "Como podemos ajudar?"
},
"header": {
"message": "Omni Z-API"
},
"footer": {
"message": "Escolha uma opção"
},
"attachments": [
{
"id": "1",
"title": "Visite nosso site",
"name": "URL",
"url": "https://www.omni.z-api.io"
},
{
"id": "2",
"title": "Fale conosco",
"name": "CALL",
"phones": [
"5511999999999"
]
}
]
}
}
'{
"messageId": "wamid.HBgNNTU0NDk3MDUwNzg1FQIAERgSM0"
}{
"error": 401,
"message": "Unauthorized"
}Conceituação
Envia uma mensagem com botões de ação para um contato. O campocontent.type deve ser INTERACTIVE_ACTION.
Tipos de botão disponíveis:
- URL — Abre um link ao clicar
- CALL — Liga para um número ao clicar
header e footer são opcionais.
Detalhes da regra do WhatsApp Oficial em janela de conversa. Veja a matriz de capacidades para todos os canais.
Autorizações
Secret Key gerada no painel de Segurança do Omni Z-API
Parâmetros de caminho
ID do canal
Exemplo:
"SEU_CHANNEL_ID"
Corpo
application/json
Resposta
Mensagem enviada com sucesso
ID da mensagem enviada