Webhook URL ayarı
Hesap düzeyinde bildirim webhook adresini kaydetmek veya güncellemek için bu endpoint kullanılır. Aynı URL ile updateOrCreate mantığı çalışır.
İstek
POST /api/helpers/settings-webhook
Accept: application/json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
İstek gövdesi
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
webhook_url | string | Evet | Geçerli https:// (veya uygun şema) URL. |
Örnek istekler
- 💻 cURL
- 🐘 PHP
- 🟢 Node.js
curl -X POST "https://app.faturaentegrator.com/api/helpers/settings-webhook" \
-H "Accept: application/json" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"webhook_url":"https://ornek.com/fatura-webhook"}'
<?php
$body = ['webhook_url' => 'https://ornek.com/fatura-webhook'];
$ch = curl_init('https://app.faturaentegrator.com/api/helpers/settings-webhook');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($body),
CURLOPT_HTTPHEADER => ['Accept: application/json', 'Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_RETURNTRANSFER => true,
]);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
await fetch('https://app.faturaentegrator.com/api/helpers/settings-webhook', {
method: 'POST',
headers: { Accept: 'application/json', Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ webhook_url: 'https://ornek.com/fatura-webhook' }),
});
Başarılı işlemde HTTP 200 ve boş gövde dönebilir.