Documentation ›
Messages › Envoyer un message WhatsApp Web
POST
Envoyer un message WhatsApp Web
POSThttps://app.sendapp.ai/api/whatsapp-web/send
Envoyez un message texte ou média via WhatsApp Web (automatisation du navigateur). Définissez
type=text pour le texte ou type=media pour joindre un fichier. Paramètres
apikey
obligatoire
Votre API Key.
token
obligatoire
Token du compte.
number
obligatoire
Numéro du destinataire (ex. 1234567890).
type
obligatoire
text ou media.
message
facultatif
Texte du message (requis si
type=text).
media_url
facultatif
URL du fichier média (requis si
type=media).
filename
facultatif
Nom du fichier pour le média.
Requête
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": "Bonjour, ceci est un message de test !"
}'<?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' => 'Bonjour, ceci est un message de test !',
]),
]);
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: 'Bonjour, ceci est un message de test !'
})
});
console.log(await res.json());Réponse (200 OK)
{
"status": "success",
"message": "Message sent successfully"
}Erreur
{
"status": "error",
"message": "No active WhatsApp Web instance found"
}