Bu API, webhookları oluşturmak için kullanılır.
{{APP_URL}}/api/v1/webhooksPOSTapplication/jsonAPIKEY| Parametre Adı | Parametre Tipi | Zorunluluk | Açıklama |
|---|---|---|---|
description |
String (MAX 255) | ZORUNLU | Webhook açıklaması |
endpoint |
String (MAX 255) | ZORUNLU | Webhook URL'si |
subscribedEvent |
String (MAX 255) | ZORUNLU | Abone olunan olay |
securityType |
String (MAX 255) | ZORUNLU | Kimrik doğrulama tipi |
dataType |
String (MAX 255) | ZORUNLU | Veri tipi |
data |
String (MAX 255) | İSTEĞE BAĞLI | Veri |
securityData |
Array | ZORUNLU | Kimlik doğrulama için Ek Güvenlik verileri |
status |
Integer | ZORUNLU | Durum |
| Parametre Adı | Parametre Tipi | Zorunluluk | Açıklama |
|---|---|---|---|
headerKey |
String (MAX 255) | ZORUNLU | Başlık anahtarı |
headerValue |
String (MAX 255) | ZORUNLU | Başlık değeri |
Aşağıda, API isteği için bir örnek JSON verisi bulunmaktadır.
POST {{APP_URL}}/api/v1/webhooks
Content-Type: application/json
Authorization: APIKEY {{APIKEY}}
{
"description": "My Tracking",
"endpoint": "https://myapi.com/status",
"subscribedEvent": "consignment.status.updated",
"securityType": "header",
"dataType": "JSON",
"data": "",
"securityData": [
{
"headerKey": "Authorization",
"headerValue": "123"
}
],
"status": 1
}
Başarılı bir istekte, API aşağıdaki gibi bir yanıt döndürecektir:
{
"status": true,
"message": "Webhook created successfully",
"data": {
"webhook_id": "WEB123456789",
"description": "My Tracking",
"endpoint": "https://myapi.com/status",
"subscribedEvent": "consignment.status.updated",
"securityType": "header",
"dataType": "JSON",
"data": "",
"securityData": [
{
"headerKey": "Authorization",
"headerValue": "123"
}
],
"status": 1,
"created_at": "2023-10-01T12:34:56Z"
}
}
API isteği başarısız olursa, API aşağıdaki gibi bir hata yanıtı döndürecektir:
{
"status": false,
"errors": [
{
"message": "Invalid endpoint URL. Please check the URL and try again."
}
]
}