hosting
PUT /v1/sites/{siteId}/wordpress/maintenance
Turn maintenance mode on or off.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز sites.view باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد میشود، نه 404.
این نقطه پایانی هیچ شناسه سازمانی را دریافت نمیکند. کلید شما در حال حاضر سازمان مربوطه را مشخص میکند و پاسخ در همان محدوده ارائه میشود.
امتحان کنید
هر چیزی را که داخل براکتهای زاویهدار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/wordpress/maintenance \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "enabled": <boolean> }'وارد شدهاید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی API زنده اجرا میکند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید
جزئیات
Hides the site behind WordPress's maintenance page, or brings it back. ⛔ **Confirmed by re-reading the flag**, never by acknowledging our own request. The flag is a file in the document root, and a write that failed on a full disk or a read-only mount exits cleanly on some hosts — so acknowledging would tell a customer their shop is hidden while it is serving orders, or the reverse. ⛔ `{"enabled": bool}` both ways, rather than two paths or a bare boolean body, so a client cannot turn maintenance mode **on** by sending a body it meant as "off". ⛔ **Fleet only** — refused where `wp_maintenance` is `false`. Requires `sites.view` and `sites.panel_access`.
پارامترها
| نام | نوع | الزامی | چیست |
|---|---|---|---|
siteId (path) | Uuid | بله | Site ID (UUIDv7). |
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
enabled | boolean | بله | Whether the site should show the maintenance page. |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
enabled | boolean | بله | True when visitors are seeing the maintenance page. |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 404 · 422 · 429 · 503