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, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі 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. |
Помилки, які може повертати ця кінцева точка
401 · 422 · 429