API dla partnerów › Ustawienia Pobierz listę subskrypcji webhooków GET /api/crm/v2/webhooks_subscriptionsv2
operationId: webhooksSubscriptions.default
Autoryzacja api-token + language + role
Parametry zapytania branch_id integer
Przykład: 8412
Odpowiedzi 200
object
status string wymagane
Wartości: successerror
Przykład: success
data object
filters object
branch_id object (FilterSelectInteger)
value integer
Przykład: 8920
type string wymagane
Przykład: select
option array of object
value integer wymagane
Przykład: 8920
name string wymagane
Przykład: Green Basket | Kaliningrad
mode string (FilterMode)
Jak interfejs obsługuje filtr; zwykły filtr nie ma mode. force_shown — zawsze widoczny, nie można ukryć. value_required — punkt wejścia do sekcji: zawsze widoczny, nie może mieć pustej wartości (dopóki wartość nie zostanie wybrana, lista jest pusta; nie ma opcji „wszystko”), ogólne resetowanie go nie czyści.
Wartości: force_shownvalue_required
Przykład: value_required
settings object (WebhooksBranchSettings)
secret string może być null
null, dopóki sieć nie utworzyła sekretu
Przykład: 9f2c…
enabled boolean wymagane
Przykład: true
list array of object
id integer wymagane
Przykład: 12
date_creation string (DataTimeFormatSQL) wymagane
Przykład: 2024-05-02 08:31:16
webhook_event_id integer wymagane
Przykład: 4
slug string wymagane
Kod zdarzenia przesyłany w treści webhooka
Przykład: order.created
translation_key string wymagane
Klucz tłumaczenia nazwy zdarzenia
Przykład: webhooksSubscriptionsEvent.orderCreated
url string wymagane
Przykład: https://partner.example.com/hooks/foodsoul
description string wymagane
Przykład: Учётная система
enabled boolean wymagane
Przykład: true
blocked boolean wymagane
Subskrypcja została automatycznie wyłączona po serii błędów
Przykład: false
count_errors integer wymagane
Liczba kolejnych nieudanych wysyłek
Przykład: 0
curl PHP JavaScript Python Kopiuj
curl -X GET 'https://foodsoul.pro/api/crm/v2/webhooks_subscriptions' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: pl' \
-H 'role: partner' <?php
$client = new \GuzzleHttp\Client ();
$response = $client -> request ( 'GET' , 'https://foodsoul.pro/api/crm/v2/webhooks_subscriptions' , [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN' ,
'language' => 'pl' ,
'role' => 'partner' ,
],
]);
$data = json_decode (( string ) $response -> getBody (), true ); const response = await fetch ( "https://foodsoul.pro/api/crm/v2/webhooks_subscriptions" , {
method : "GET" ,
headers : {
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "pl" ,
"role" : "partner"
},
})
const data = await response . json () import requests
response = requests . request (
"GET" ,
"https://foodsoul.pro/api/crm/v2/webhooks_subscriptions" ,
headers ={
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "pl" ,
"role" : "partner" ,
},
)
data = response . json () Odpowiedź 200
{
"status" : "success" ,
"data" : {
"filters" : {
"branch_id" : {
"value" : 8920 ,
"type" : "select" ,
"option" : [
{
"value" : 8920 ,
"name" : "Green Basket | Kaliningrad"
}
],
"mode" : "value_required"
}
},
"settings" : {
"secret" : "9f2c…" ,
"enabled" : true
},
"list" : [
{
"id" : 12 ,
"date_creation" : "2024-05-02 08:31:16" ,
"webhook_event_id" : 4 ,
"slug" : "order.created" ,
"translation_key" : "webhooksSubscriptionsEvent.orderCreated" ,
"url" : "https://partner.example.com/hooks/foodsoul" ,
"description" : "Учётная система" ,
"enabled" : true ,
"blocked" : false ,
"count_errors" : 0
}
]
}
} Żądania są wysyłane na foodsoul.pro — to jest host tego portalu, nie można wybrać innego.