connections
POST /v1/waap/domains/{domainId}/mode
Switch a protected domain between monitor, block and off.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу connections.manage; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/waap/domains/{domainId}/mode \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "mode": <string<monitor, block, off>> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
The one call here that changes whether traffic is refused. Requires connections.manage: it writes to the customer's connected account, so the read key the list call takes is not enough. ⛔ The response reports the mode the provider says is now in force, which is not necessarily the one that was requested: providers apply some transitions asynchronously and refuse others outright. Echoing the request back would leave every screen showing a protection state that was never applied. ⛔ locked is rejected with 422: it is a state the provider assigns, never one that can be requested, and accepting it would build a control that always fails.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
domainId (path) | string | Да | The provider's id for the protected domain. |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
mode | string<monitor, block, off> | Да | ⛔ locked is absent on purpose: it is a state the provider assigns, never one that can be requested, and the API answers 422 for it. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | string | Да | — |
domain | string | Да | — |
mode | string<monitor, block, off, locked> | Да | ⛔⛔ monitor logs every match and delivers the traffic anyway. It produces analytics and blocks nothing, and on a dashboard it is indistinguishable from block unless this… |
created_at | string | Не | — |
total_requests | integer | Не | ⛔ null when the provider does not report it — never 0. |
blocked_requests | integer | Не | ⛔ null when unknown. "Nothing was blocked" and "we cannot see what was blocked" are opposite answers and must not render alike. |
Грешке које ова крајња тачка може вратити
401 · 403 · 422 · 429