API
Iniciar sesión
Documentación › Mensajes › Enviar mensaje de WhatsApp Web
POST

Enviar mensaje de WhatsApp Web

POSThttps://app.sendapp.ai/api/whatsapp-web/send
Envía un mensaje de texto o media a través de WhatsApp Web (automatización de navegador). Establece type=text para texto o type=media para adjuntar un archivo.
Parámetros
apikey obligatorio
Tu API Key.
token obligatorio
Token de la cuenta.
number obligatorio
Número del destinatario (p. ej. 1234567890).
type obligatorio
text o media.
message opcional
Texto del mensaje (obligatorio si type=text).
media_url opcional
URL del archivo media (obligatorio si type=media).
filename opcional
Nombre del archivo para el media.
Solicitud
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": "¡Hola, este es un mensaje de prueba!"
  }'
<?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' => '¡Hola, este es un mensaje de prueba!',
    ]),
]);
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: '¡Hola, este es un mensaje de prueba!'
  })
});
console.log(await res.json());
Respuesta (200 OK)
{
  "status": "success",
  "message": "Message sent successfully"
}
Error
{
  "status": "error",
  "message": "No active WhatsApp Web instance found"
}