Dokumentation ›
Status-Webhook › Status-Webhook — WhatsApp Meta
POST
Status-Webhook — WhatsApp Meta
POSThttps://app.sendapp.ai/api/whatsapp-meta/set_webhook
Registrieren Sie (POST) eine URL auf Ihrem Server, um in Echtzeit Statusereignisse von Meta-Nachrichten (sent, delivered, read, failed) und eingehende Ereignisse zu empfangen. Jedes Meta-Webhook-Ereignis wird unverändert per HTTP POST an Ihre URL weitergeleitet. Verwenden Sie DELETE, um den registrierten Webhook zu entfernen.
Ihr Server muss innerhalb von 5 Sekunden mit HTTP 200 antworten. Fehler an Ihrem Endpunkt werden stillschweigend ignoriert.
Parameter
apikey
erforderlich
Ihr API Key.
token
erforderlich
Konto-Token.
url
optional
Ihre Server-URL (HTTPS). Für DELETE nicht erforderlich.
Anfrage
# Webhook registrieren
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/set_webhook' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "token": "YOUR_ACCOUNT_TOKEN", "url": "https://your-server.com/webhook" }'
# Webhook entfernen
curl -X DELETE 'https://app.sendapp.ai/api/whatsapp-meta/set_webhook' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "token": "YOUR_ACCOUNT_TOKEN" }'<?php
// Webhook registrieren
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-meta/set_webhook');
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',
'url' => 'https://your-server.com/webhook',
]),
]);
echo curl_exec($ch);
curl_close($ch);// Webhook registrieren
const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/set_webhook', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
url: 'https://your-server.com/webhook'
})
});
console.log(await res.json());Antwort (200 OK)
{
"status": "success",
"message": "Webhook URL saved successfully."
}Fehler
{
"status": "error",
"message": "Instance not found"
}