Notify API
Mit der Notify API beauftragen Sie CheckYout, eine WhatsApp-Nachricht an eine bestimmte Telefonnummer zu senden — typischerweise an die Reinigungskraft für eine bestimmte Unterkunft.
Endpoint
POST
/api/v1/notifyRequest
| Header | Wert | Pflicht |
|---|---|---|
Content-Type | application/json | Ja |
X-API-Key | Ihr API-Key | Ja |
Request-Body
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
device_id | string | Ja | UUID des CheckYout-Geräts. Muss Ihrem Account gehören. |
phone | string | Ja | Telefonnummer im E.164-Format (z.B. +41791234567) |
name | string | Nein | Anzeigename der Unterkunft in der WhatsApp-Nachricht. Fallback: property_name des Geräts. |
Response
Erfolgsantwort (200)
{
"success": true,
"message_sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}Fehlerantworten
| Status | Ursache | Beispiel |
|---|---|---|
400 | Fehlende Pflichtfelder | {"error": "Missing required fields: device_id, phone"} |
400 | Ungültiges Telefonnummernformat | {"error": "Phone must be in E.164 format (starting with +)"} |
401 | Ungültiger oder fehlender API-Key | {"error": "Invalid or missing API key"} |
404 | Gerät nicht gefunden oder gehört nicht zum Account | {"error": "Device not found or does not belong to your account"} |
500 | WhatsApp-Versand fehlgeschlagen | {"error": "Failed to send WhatsApp", "details": "..."} |
Code-Beispiele
curl -X POST https://checkyout.app/api/v1/notify \
-H "Content-Type: application/json" \
-H "X-API-Key: cyo_IhrApiKey" \
-d '{
"device_id": "d4f8a2b1-3c5e-4f6a-8b9c-1d2e3f4a5b6c",
"phone": "+41791234567",
"name": "Ferienwohnung Alpenblick"
}'const response = await fetch('https://checkyout.app/api/v1/notify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.CHECKYOUT_API_KEY,
},
body: JSON.stringify({
device_id: 'd4f8a2b1-3c5e-4f6a-8b9c-1d2e3f4a5b6c',
phone: '+41791234567',
name: 'Ferienwohnung Alpenblick',
}),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error);
}
const data = await response.json();
console.log('Nachricht gesendet:', data.message_sid);import requests
import os
response = requests.post(
"https://checkyout.app/api/v1/notify",
headers={
"Content-Type": "application/json",
"X-API-Key": os.environ["CHECKYOUT_API_KEY"],
},
json={
"device_id": "d4f8a2b1-3c5e-4f6a-8b9c-1d2e3f4a5b6c",
"phone": "+41791234567",
"name": "Ferienwohnung Alpenblick",
},
)
response.raise_for_status()
data = response.json()
print(f"Nachricht gesendet: {data['message_sid']}")<?php
$ch = curl_init('https://checkyout.app/api/v1/notify');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: ' . getenv('CHECKYOUT_API_KEY'),
],
CURLOPT_POSTFIELDS => json_encode([
'device_id' => 'd4f8a2b1-3c5e-4f6a-8b9c-1d2e3f4a5b6c',
'phone' => '+41791234567',
'name' => 'Ferienwohnung Alpenblick',
]),
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode !== 200) {
throw new Exception('Fehler: ' . $response);
}
$data = json_decode($response, true);
echo 'Nachricht gesendet: ' . $data['message_sid'];Hinweise
WhatsApp-Template
Die gesendete Nachricht verwendet ein von CheckYout vordefiniertes WhatsApp-Template. Templates sind in 9 Sprachen verfügbar: DE, EN, FR, ES, IT, NL, HR, EL, PT. Die Sprache wird automatisch anhand der Gastgeber-Einstellungen gewählt.
Benachrichtigungskanäle
Neben WhatsApp unterstützt CheckYout auch E-Mail und Webhook als Benachrichtigungskanäle. Die Konfiguration erfolgt im CheckYout-Dashboard pro Unterkunft.
Nächster Schritt: Events Referenz