Webhook kaydet
Herkese açık URL'yi desteklenen olaylara abone eder. Her uç noktanın HMAC-SHA256 gizli anahtarı oluşturulurken bir kez gösterilir. Kaybolursa uç noktayı kaldırıp yeniden ekleyin.
https://notpanel.com/api/v3action=webhook.addapplication/x-www-form-urlencodedParametreler
| Ad | Tür | Açıklama |
|---|---|---|
| keyZorunlu | string | API anahtarınız. |
| actionZorunlu | string | Birebir "webhook.add" dizesi olmalıdır. |
| urlZorunlu | string (URL) | POST'ları alacak herkese açık HTTPS uç noktası. Herkese açık internetten erişilebilir olmalıdır. |
| events | string (CSV) | Aşağıdaki altı desteklenen olayın virgülle ayrılmış alt kümesi. Altısına da abone olmak için atlayın. |
Örnek istek
YOUR_API_KEY değerini panonuzun API sayfası altında oluşturulan anahtarla değiştirin.
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=webhook.add&url=https://your-server.example.com/notpanel-webhook&events=order.completed,order.refunded"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "webhook.add",
url: "https://your-server.example.com/notpanel-webhook",
events: "order.completed,order.refunded",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "webhook.add",
"url": "https://your-server.example.com/notpanel-webhook",
"events": "order.completed,order.refunded",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'webhook.add',
'url' => 'https://your-server.example.com/notpanel-webhook',
'events' => 'order.completed,order.refunded',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
Örnek yanıt
{
"webhook_id": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
"url": "https://your-server.example.com/notpanel-webhook",
"secret": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"events": [
"order.completed",
"order.refunded"
]
}Yaygın hatalar
| Durum | Gövde | Neden |
|---|---|---|
| 400 | {"error":"Maximum 5 webhook endpoints per API key"} | Mevcut uç noktalar üst sınırı tüketti. Önce action=webhook.remove ile kullanılmayan bir uç noktayı kaldırın. |
| 400 | {"error":"Webhook URL must be a publicly reachable HTTPS URL"} | URL geçerli bir HTTPS adresi değildi, ayrıştırılamadı veya özel/loopback bir IP’ye çözümlendi. |
| 400 | {"error":"Webhook event is invalid","error_code":"INVALID_WEBHOOK_EVENT"} | Olay adı izin listesinde değil. Yazımı yeniden kontrol edin — adlar "order.<status>" biçimini kullanır. |