hosting

POST /v1/sites/{siteId}/protection/directories

Password-protect a folder on a site.

Të gjitha pikat e skajshme hosting

Autentifikimi

Drgoni një çelës API si një token mbajtës. Çelësi duhet të ketë lejen sites.view; një çelës pa të refuzohet me 403, jo 404.

Ky pikëndalim nuk pranon id të organizatës. Çelësi juaj tashmë identifikon organizatën së cilës i përket dhe përgjigjja kufizohet vetëm për atë.

Provoje

Zëvendësoni çdo gjë brenda kllapave këndore me vlerat tuaja dhe vendbanuesin e çelësit me një çelës nga paneli juaj.

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/protection/directories \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "directory": <string>, "username": <string> }'

Jeni kyçur? Konsola e API-së në panelin tuaj plotëson ID-në tuaj reale të organizatës dhe çelësin tuaj, dhe ekzekuton kërkesën kundrejt API-së live, kështu që ju mund të shihni përgjigjen aktuale. Hapni këtë pikë fundore në konsolën e API-së

Detajet

Puts an HTTP password on one folder under the document root. `POST` and not a `PUT` of the whole set even though the vendor endpoint replaces it: the set is rebuilt by the engine from the entries the platform itself returned, precisely because we do not hold the other folders' passwords and must not ask a customer to re-enter them to protect a new one. ⛔ **The response carries a password, and it is the only one on this surface that does.** Omit `password` and the engine generates a strong one; either way the value is returned **exactly once**, written to no record of ours, and readable back by no endpoint. The whole response is therefore a credential: a client displays it once and does not cache it, store it in a query cache, put it in a URL, or include it in an error report. `username` may not contain a colon or a space — `:` separates the name from the hash in an `.htpasswd` file, so a name containing one produces a file that parses into something other than what was written. `404` for a site with no vendor hosting package. Requires `sites.view` and `sites.panel_access`.

Parametrat

EmriLlojiKërkohetÇfarë është kjo
siteId (path)UuidPoSite ID (UUIDv7).

Trupi i kërkesës

EmriLlojiKërkohetÇfarë është kjo
directorystringPoThe folder to protect, relative to the document root. It is normalised before it is compared with what the vendor holds, so what is protected is the folder the customer meant.
usernamestringPoThe name a visitor types. No colon and no space, because this is written into an `.htpasswd` file where `:` is the field separator.
passwordstringJoOptional. Omitting it means *generate one for me*, which is the path that guarantees a strong value. Write-only: whatever is sent here appears in no response, no log line and no…

Përgjigja

EmriLlojiKërkohetÇfarë është kjo
directorySiteProtectedDirectoryPoThe folder, exactly as `getSiteProtection` will report it.
passwordstringPoThe password, shown once. Deliberately carries no example — a documented example of a credential field is the shape people copy. ⛔ It never contains a colon: this value is writt…

Gabimet që ky pikëndalim mund të kthejë

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