curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "text", "text": {"body": "Olá, como posso ajudar?"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "image", "media": {"mimeType": "image/png", "url": "https://exemplo.com/foto.png", "caption": "Foto do produto"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "video", "media": {"mimeType": "video/mp4", "url": "https://exemplo.com/video.mp4", "caption": "Vídeo tutorial"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "audio", "media": {"mimeType": "audio/ogg", "url": "https://exemplo.com/audio.ogg", "caption": "Mensagem de voz"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "document", "media": {"mimeType": "application/pdf", "url": "https://exemplo.com/contrato.pdf", "caption": "Contrato"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "sticker", "media": {"mimeType": "image/webp", "url": "https://exemplo.com/sticker.webp"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "interactive", "interactive": {"type": "button_reply", "button_reply": {"id": "btn_support", "title": "Suporte"}}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "interactive", "interactive": {"type": "list_reply", "list_reply": {"id": "row_pricing", "title": "Planos e Preços"}}}'
{
"messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "queued"
}
Sessões
Enviar Mensagem
Envie uma mensagem para uma sessão ativa.
POST
/
v1
/
sessions
/
{sessionId}
/
message
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "text", "text": {"body": "Olá, como posso ajudar?"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "image", "media": {"mimeType": "image/png", "url": "https://exemplo.com/foto.png", "caption": "Foto do produto"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "video", "media": {"mimeType": "video/mp4", "url": "https://exemplo.com/video.mp4", "caption": "Vídeo tutorial"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "audio", "media": {"mimeType": "audio/ogg", "url": "https://exemplo.com/audio.ogg", "caption": "Mensagem de voz"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "document", "media": {"mimeType": "application/pdf", "url": "https://exemplo.com/contrato.pdf", "caption": "Contrato"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "sticker", "media": {"mimeType": "image/webp", "url": "https://exemplo.com/sticker.webp"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "interactive", "interactive": {"type": "button_reply", "button_reply": {"id": "btn_support", "title": "Suporte"}}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "interactive", "interactive": {"type": "list_reply", "list_reply": {"id": "row_pricing", "title": "Planos e Preços"}}}'
{
"messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "queued"
}
Envie uma mensagem para uma sessão ativa. O motor de fluxos processa a mensagem, avança para o próximo nó e entrega a resposta para a URL de callback.
Sua chave de API (prefixada com
wh_).O UUID da sessão ativa.
Body
Tipo da mensagem:
text, interactive, image, video, audio, document ou sticker.Payload de texto. Envie quando
type for text.Mostrar Campos
Mostrar Campos
O conteúdo de texto da mensagem.
Payload interativo. Envie quando
type for interactive.Mostrar Campos
Mostrar Campos
Tipo de interação:
button_reply ou list_reply.Exemplos de payload
- Texto
- Imagem
- Vídeo
- Áudio
- Documento
- Sticker
- Botão
- Lista
{
"type": "text",
"text": {
"body": "Olá, como posso ajudar?"
}
}
{
"type": "image",
"media": {
"mimeType": "image/png",
"url": "https://exemplo.com/foto.png",
"caption": "Foto do produto"
}
}
{
"type": "video",
"media": {
"mimeType": "video/mp4",
"url": "https://exemplo.com/video.mp4",
"caption": "Vídeo tutorial"
}
}
{
"type": "audio",
"media": {
"mimeType": "audio/ogg",
"url": "https://exemplo.com/audio.ogg",
"caption": "Mensagem de voz"
}
}
{
"type": "document",
"media": {
"mimeType": "application/pdf",
"url": "https://exemplo.com/contrato.pdf",
"caption": "Contrato"
}
}
{
"type": "sticker",
"media": {
"mimeType": "image/webp",
"url": "https://exemplo.com/sticker.webp"
}
}
{
"type": "interactive",
"interactive": {
"type": "button_reply",
"button_reply": {
"id": "btn_support",
"title": "Suporte"
}
}
}
{
"type": "interactive",
"interactive": {
"type": "list_reply",
"list_reply": {
"id": "row_pricing",
"title": "Planos e Preços"
}
}
}
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "text", "text": {"body": "Olá, como posso ajudar?"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "image", "media": {"mimeType": "image/png", "url": "https://exemplo.com/foto.png", "caption": "Foto do produto"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "video", "media": {"mimeType": "video/mp4", "url": "https://exemplo.com/video.mp4", "caption": "Vídeo tutorial"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "audio", "media": {"mimeType": "audio/ogg", "url": "https://exemplo.com/audio.ogg", "caption": "Mensagem de voz"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "document", "media": {"mimeType": "application/pdf", "url": "https://exemplo.com/contrato.pdf", "caption": "Contrato"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "sticker", "media": {"mimeType": "image/webp", "url": "https://exemplo.com/sticker.webp"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "interactive", "interactive": {"type": "button_reply", "button_reply": {"id": "btn_support", "title": "Suporte"}}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
-H "X-Api-Key: wh_your_api_key" \
-H "Content-Type: application/json" \
-d '{"type": "interactive", "interactive": {"type": "list_reply", "list_reply": {"id": "row_pricing", "title": "Planos e Preços"}}}'
{
"messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "queued"
}
⌘I