Documentação ›
Mensagens › Enviar mensagem WhatsApp Web
POST
Enviar mensagem WhatsApp Web
POSThttps://app.sendapp.ai/api/whatsapp-web/send
Envie uma mensagem de texto ou media através do WhatsApp Web (automação de navegador). Defina
type=text para texto ou type=media para anexar um ficheiro. Parâmetros
apikey
obrigatório
A tua API Key.
token
obrigatório
Token da conta.
number
obrigatório
Número do destinatário (ex. 1234567890).
type
obrigatório
text ou media.
message
opcional
Texto da mensagem (obrigatório se
type=text).
media_url
opcional
URL do ficheiro media (obrigatório se
type=media).
filename
opcional
Nome do ficheiro para o media.
Pedido
curl -X POST 'https://app.sendapp.ai/api/whatsapp-web/send' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"number": "1234567890",
"type": "text",
"message": "Olá, esta é uma mensagem de teste!"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-web/send');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'apikey' => 'YOUR_API_KEY',
'token' => 'YOUR_ACCOUNT_TOKEN',
'number' => '1234567890',
'type' => 'text',
'message' => 'Olá, esta é uma mensagem de teste!',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/whatsapp-web/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
number: '1234567890',
type: 'text',
message: 'Olá, esta é uma mensagem de teste!'
})
});
console.log(await res.json());Resposta (200 OK)
{
"status": "success",
"message": "Message sent successfully"
}Erro
{
"status": "error",
"message": "No active WhatsApp Web instance found"
}