API referansı
Auto Replies
Anahtar kelime, regex veya mesai saatine göre tetiklenen otomatik yanıt kuralları.
get
/auto-repliesOtomatik yanıtları listele
Gerekli yetki: messages:read
Sorgu parametreleri
is_active | boolean | |
trigger_type | string | Değerler: keyword, regex, all, first_message, business_hours |
İstek örneği
curl -X GET "https://api.zenwapp.com/api/v1/whatsapp/external/auto-replies" \
-H "Authorization: Bearer $ZENWAPP_API_KEY"Yanıt kodları
200Kural listesi
post
/auto-repliesOtomatik yanıt oluştur
Birden fazla kural eşleşirse `priority` değeri büyük olan kazanır. `delay_seconds` ile insan benzeri gecikme verebilirsiniz.
Gerekli yetki: messages:send
Gövde alanları
namezorunlu | string | |
trigger_type | string | Değerler: keyword, regex, all, first_message, business_hoursVarsayılan: "keyword" |
trigger_value | string | Anahtar kelime veya regex deseni. |
response_type | string | Varsayılan: "text" |
response_content | string | |
template_id | uuid | |
media_url | string | |
delay_seconds | integer | Varsayılan: 0 |
priority | integer | Varsayılan: 0 |
conditions | object | |
is_active | boolean | Varsayılan: true |
İstek örneği
curl -X POST "https://api.zenwapp.com/api/v1/whatsapp/external/auto-replies" \
-H "Authorization: Bearer $ZENWAPP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Fiyat sorusu","trigger_type":"keyword","trigger_value":"fiyat","response_content":"Fiyat listemizi hemen paylaşıyorum.","delay_seconds":3}'Yanıt 400
{
"error": "validation_error",
"message": "Missing required field: to"
}Yanıt kodları
201Oluşturuldu400Gövde veya sorgu parametreleri geçersiz
get
/auto-replies/{id}Otomatik yanıt detayı
Gerekli yetki: messages:read
Yol parametreleri
idzorunlu | uuid | Kaynak kimliği (UUID). |
İstek örneği
curl -X GET "https://api.zenwapp.com/api/v1/whatsapp/external/auto-replies/00000000-0000-0000-0000-000000000000" \
-H "Authorization: Bearer $ZENWAPP_API_KEY"Yanıt 404
{
"error": "not_found",
"message": "Resource not found"
}Yanıt kodları
200Detay404Kaynak bulunamadı
put
/auto-replies/{id}Otomatik yanıtı güncelle
Gerekli yetki: messages:send
Yol parametreleri
idzorunlu | uuid | Kaynak kimliği (UUID). |
İstek örneği
curl -X PUT "https://api.zenwapp.com/api/v1/whatsapp/external/auto-replies/00000000-0000-0000-0000-000000000000" \
-H "Authorization: Bearer $ZENWAPP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"is_active":false}'Yanıt 404
{
"error": "not_found",
"message": "Resource not found"
}Yanıt kodları
200Güncellendi404Kaynak bulunamadı
delete
/auto-replies/{id}Otomatik yanıtı sil
Gerekli yetki: messages:send
Yol parametreleri
idzorunlu | uuid | Kaynak kimliği (UUID). |
İstek örneği
curl -X DELETE "https://api.zenwapp.com/api/v1/whatsapp/external/auto-replies/00000000-0000-0000-0000-000000000000" \
-H "Authorization: Bearer $ZENWAPP_API_KEY"Yanıt 404
{
"error": "not_found",
"message": "Resource not found"
}Yanıt kodları
200Silindi404Kaynak bulunamadı