connections
POST /v1/waap/domains/{domainId}/mode
Switch a protected domain between monitor, block and off.
Упълномощаване
Изпратете API ключ като носител (bearer token). Тази точка за достъп не указва конкретно разрешение в спецификацията, затова дайте на ключа си най-малкото необходимо и проверете отговора, вместо да правите предположения.
Този ендпойнт не изисква идентификатор на организация. Вашият ключ вече идентифицира организацията, към която принадлежи, и отговорът е ограничен до нея.
Опитайте
Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.
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 конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата
Детайли
The one call here that changes whether traffic is refused. ⛔ 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. |
Грешки, които този крайpoint може да върне
401 · 422 · 429