connections
POST /v1/waap/domains/{domainId}/mode
Switch a protected domain between monitor, block and off.
Autenticazione
Invia una chiave API come bearer token. Questo endpoint non specifica un permesso specifico nella specifica, quindi assegna alla tua chiave i permessi minimi necessari e verifica la risposta invece di fare supposizioni.
Questo endpoint non richiede alcun ID organizzazione. La tua chiave identifica già l'organizzazione a cui appartiene e la risposta è limitata ad essa.
Provalo
Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua dashboard.
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>> }'Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API
Dettagli
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.
Parametri
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
domainId (path) | string | Sì | The provider's id for the protected domain. |
Corpo della richiesta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
mode | string<monitor, block, off> | Sì | ⛔ `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. |
Risposta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
id | string | Sì | — |
domain | string | Sì | — |
mode | string<monitor, block, off, locked> | Sì | ⛔⛔ `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 | No | — |
total_requests | integer | No | ⛔ `null` when the provider does not report it — never `0`. |
blocked_requests | integer | No | ⛔ `null` when unknown. "Nothing was blocked" and "we cannot see what was blocked" are opposite answers and must not render alike. |
Errori che questo endpoint può restituire
401 · 422 · 429