partner
POST /v1/partner/webhooks
Subscribe an endpoint to your customers' events.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу partner.domains; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/partner/webhooks \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "endpoint": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Returns the signing secret ONCE — store it before you close the response. The subscription starts unverified and receives only a signed verification POST; answer it 2xx and it becomes active. Every POST carries X-Zinn-Signature (sha256= HMAC over "<X-Zinn-Timestamp>.<raw body>"), X-Zinn-Delivery and X-Zinn-Event. Re-subscribing an endpoint you already have re-keys and re-verifies it. Requires partner.domains.
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
endpoint | string | Да | An https:// URL we can reach from the public internet. Judged again when the socket opens, so an address that resolves to a private range is refused at delivery time as well as… |
events | string[] | Не | Omit or leave empty for every event type we publish. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | string | Да | — |
endpoint | string | Да | — |
events | string[] | Да | The event types this endpoint receives. An empty list means every type we publish, including ones added later. |
status | string<active, unverified, suspended> | Да | unverified until your endpoint answers 2xx to our signed verification POST — until then it receives nothing else. suspended after 20 consecutive failures. |
verified_at | string | Да | — |
consecutive_failures | integer | Да | — |
last_delivery_at | string | Да | — |
last_failure_at | string | Да | — |
last_delivery_error | string | Да | Why the last delivery failed, as your endpoint answered it — empty once a delivery succeeds. This is the field to read when status is suspended: the count tells you the… |
signing_secret | string | Не | The HMAC key for X-Zinn-Signature. Returned ONCE, on creation, and never again — we keep only what is needed to sign. Lost it? Subscribe the same endpoint again and you get a… |
Грешке које ова крајња тачка може вратити
401 · 403 · 422 · 429