Skip to main content

Get one of a catalog template's screenshots

GET 

/catalog/:id/screenshots/:index

Required role: viewer. An account or token with the viewer or admin role can call this operation.

Example request
curl --request GET \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
"https://$HOSERVA_HOST:8008/api/v1/catalog/{id}/screenshots/{index}"

The screenshot at that position of the template's screenshots list, with a content type from an allow-list (PNG, WebP or JPEG) chosen by the file's extension, never by its content. It is addressed by position, so no file path ever appears in a request. A file that is not a plain file inside the template's own directory (a symlink in the path or as the file, however it points), has another extension, or is larger than 4 MiB is not served, and neither is a position past the end of the list: 404 template_screenshot_not_found. An unknown template is 404 template_not_found. The response forbids content sniffing and anything but the image itself. An <img> element loads it, which cannot send the X-Hoserva-Session-Secret header, so the session cookie alone is accepted here.

Request​

Responses​

The screenshot.

Response Headers
    Content-Security-Policy
    X-Content-Type-Options