hosting
POST /v1/sites/{siteId}/protection/file-permissions
Apply the vendor's recommended permissions on a site.
Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение sites.view; ключ без него отклоняется с кодом 403, а не 404.
Этот эндпоинт не принимает идентификатор организации. Ваш ключ уже определяет организацию, к которой он принадлежит, и ответ ограничивается ее рамками.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/protection/file-permissions \
-H "Authorization: Bearer zdk_live_…"Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Changes file modes on the customer's live files to the vendor's own recommendation. ⛔ It takes no body, and that is the security property. The check is re-run inside the same vendor conversation and the recommendation is applied against the handle that conversation just produced, so a stale check_id from a client cannot be replayed against files that have changed since. The only defensible input to an operation that alters file modes is the number the platform running it published moments ago. A report with nothing to fix is a 422 refusal rather than a silent success: "we changed nothing" and "there was nothing to change" are different sentences, and only one of them is reassuring. Files the vendor named without naming a mode are skipped, never sent with a guess. 404 for a site with no vendor hosting package. Requires sites.view and sites.panel_access.
Параметры
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
siteId (path) | Uuid | Да | Site ID (UUIDv7). |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
check_id | integer | Да | The vendor's handle for this check. Null when the vendor gave us none, in which case there is nothing to apply and actionable is false. ⛔ A client never sends it back:… |
public_html_wrong | boolean | Да | Whether the document root's own mode is wrong. |
root_wrong | boolean | Да | Whether the package root's own mode is wrong. |
failures | SitePermissionFailure[] | Да | The individual files the check flagged. |
actionable | boolean | Да | Whether Fix these can do anything: a live check handle and something to fix. Its own field so the button is not offered against a report that can only be refused. |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 404 · 409 · 422 · 429 · 503