connections
POST /v1/connections/{provider}
Validate or store a provider access token.
Упълномощаване
Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението connections.manage; ключ без него се отхвърля с 403, а не с 404.
Където отива идентификаторът на вашата организация
Този ендпойнт приема org_id като параметър на заявката. Оставете го празен и извикването ще обхване цялото ви поддървано дърво; изпратете го, за да ограничите извикването до една организация.
ИД на вашата организация се намира на екрана с API ключове във вашето табло за управление, до самия ключ. Това е същият ИД във всяко заявка, която правите.
Опитайте
Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.
curl -X POST https://api.zinndigital.com/v1/connections/{provider} \
-H "Authorization: Bearer zdk_live_…"Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата
Детайли
With `validate_only` the token is checked and nothing is stored, and the result is returned with 200 **even when the token is invalid** — an invalid token is an answer the caller renders, not a request error. Without it the token is re-validated and then stored in Vault, returning 201; a token that fails validation is rejected with `TOKEN_INVALID` and never persisted. The token itself is never logged or echoed. Requires `connections.manage`.
Параметри
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
provider (path) | ConnectionProvider | Да | The third-party provider whose connections are addressed. |
org_id (query) | Uuid | Не | Which organization this connected account belongs to. Required when the caller manages connections for more than one — a reseller or an agency by construction — because a creden… |
Idempotency-Key (header) | string | Не | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Отговор
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
valid | boolean | Да | — |
account_login | object | Да | The account the token authenticates as, when valid. |
scopes | string[] | Да | — |
missing_scopes | string[] | Да | Required scopes the token lacks. Empty when the token is valid, and also empty when the provider could not enumerate its permissions — in that case the connection is usable but… |
message | object | Да | Human-readable explanation, or null when valid. |
permissions | PermissionReport | null | Не | The per-permission checklist, exercised against the provider. ⛔ `null` means **we cannot test this provider's permissions** — it does not mean "nothing is required". The two rea… |
Грешки, които този крайpoint може да върне
401 · 403 · 422 · 429 · 503