hosting

PUT /v1/sites/{siteId}/directory-index

Set a site's index files, its folder listing, or both.

Всички крайни точки в hosting

Упълномощаване

Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението sites.view; ключ без него се отхвърля с 403, а не с 404.

Този ендпойнт не изисква идентификатор на организация. Вашият ключ вече идентифицира организацията, към която принадлежи, и отговорът е ограничен до нея.

Опитайте

Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.

curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/directory-index \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата

Детайли

⛔ **An omitted field means *leave it alone*.** Each control sends only itself: resending `files` alongside a listing change would write back a list the screen may have rendered from a stale read and clobber an edit somebody else made. A body with neither field is a no-op, not an error. Turning folder listing **on** publishes the names of every file in any folder with no index page, which on a site with backups or exports in the document root is a disclosure — so the client says that before calling. The whole new state is returned either way. `404` for a site with no managed hosting package. Requires `sites.view` and `sites.panel_access`.

Параметри

ИмеТипЗадължителноКакво представлява
siteId (path)UuidДаSite ID (UUIDv7).

Тяло на заявката

ИмеТипЗадължителноКакво представлява
filesstring[]НеThe index file names, in the order the server tries them. Plain file names only — a path or a wildcard is refused `422` before the vendor is called. Omit to leave the current li…
listing_enabledbooleanНеWhether a folder with no index file lists its contents. Omit, or send null, to leave it untouched.

Отговор

ИмеТипЗадължителноКакво представлява
filesstring[]ДаThe index file names, in the order the server tries them.
listing_enabledbooleanДаWhether a folder with no index file lists its contents. **Null** when the vendor does not report it — distinct from `false`, because a switch rendered from an unknown lies about…
permittedbooleanДаWhether the package type includes the directory-index controls.

Грешки, които този крайpoint може да върне

401 · 403 · 404 · 409 · 422 · 429 · 503