connections
POST /v1/waap/domains/{domainId}/mode
Switch a protected domain between monitor, block and off.
Pengesahan
Hantar kunci API sebagai token pembawa. Titik akhir ini tidak menyatakan kebenaran tertentu dalam spesifikasi, jadi berikan kunci anda kebenaran minimum yang diperlukan dan semak respons tersebut daripada membuat andaian.
Titik akhir ini tidak memerlukan id organisasi. Kunci anda telah mengenal pasti organisasi kepunyaannya, dan respons dis skopkan kepadanya.
Cuba
Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.
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>> }'Sudah log masuk? Konsol API dalam papan pemuka anda mengisi id organisasi sebenar dan kunci anda sendiri, serta menjalankan permintaan terhadap API langsung supaya anda boleh melihat respons sebenar. Buka penamat ini dalam konsol API
Butiran
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.
Parameter
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
domainId (path) | string | Ya | The provider's id for the protected domain. |
Badan permintaan
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
mode | string<monitor, block, off> | Ya | ⛔ `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. |
Respons
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
id | string | Ya | — |
domain | string | Ya | — |
mode | string<monitor, block, off, locked> | Ya | ⛔⛔ `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 | Tidak | — |
total_requests | integer | Tidak | ⛔ `null` when the provider does not report it — never `0`. |
blocked_requests | integer | Tidak | ⛔ `null` when unknown. "Nothing was blocked" and "we cannot see what was blocked" are opposite answers and must not render alike. |
Ralat yang boleh dikembalikan oleh titik akhir ini
401 · 422 · 429