Ana içeriğe geç

Distributor Oluştur

Bir node için yeni bir distributor oluşturun.

Endpoint: POST /api/v1/integration/distributors/nodes/{node_id}

Kimlik Doğrulama: Gerekli (Bearer token)

Gerekli Header'lar:

Authorization: Bearer <access_token>
X-Target-Server: integration

Yol Parametreleri

ParametreTipGerekliAçıklama
node_idstring (UUID)EvetNode ID

İstek Gövdesi

{
"meta": {
"host": "https://example.com",
"path": "/webhook",
"method": 1,
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
}
}
}

İstek Parametreleri

AlanTipGerekliAçıklama
metaobjectHayırWebhook yapılandırması (opsiyonel)
meta.hoststringHayırWebhook host URL'i (meta verilmişse gerekli)
meta.pathstringHayırWebhook path'i (meta verilmişse gerekli)
meta.methodintegerHayırHTTP metodu (1=GET, 2=POST, vb.)
meta.authenticationobjectHayırKimlik doğrulama yapılandırması
meta.authentication.typeintegerHayırKimlik doğrulama tipi (1=Basic, 2=Token)
meta.authentication.usernamestringHayırKullanıcı adı (type=1 ise gerekli)
meta.authentication.passwordstringHayırŞifre (type=1 ise gerekli)

Not: meta alanı opsiyoneldir. Distributor'ı webhook yapılandırması ile veya webhook olmadan oluşturabilirsiniz.

Yanıt

Durum: 201 Created

Oluşturulan distributor nesnesini döndürür.

{
"id": "39e8003c-6342-4fd3-97a1-3f2a7b437d0a",
"node_id": "e40efce4-38a3-46c4-a202-e8db95d0409c",
"meta": {
"host": "https://example.com",
"path": "/webhook",
"method": "GET",
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
}
},
"created_at": "2025-12-24T02:16:10.419696+03:00",
"updated_at": "2025-12-24T02:16:10.419696+03:00"
}

Örnek cURL İsteği

curl -X POST 'https://<base-url>/api/v1/integration/distributors/nodes/e40efce4-38a3-46c4-a202-e8db95d0409c' \
-H "Content-Type: application/json" \
-H "X-Target-Server: integration" \
-H "Authorization: Bearer <access_token>" \
-d '{
"meta": {
"host": "https://example.com",
"path": "/webhook",
"method": 1,
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
}
}
}'