Headless Server Developer Manual / Version 2301
Table Of ContentsThe media endpoint consists of the following distinct endpoints:
Endpoint for images with crops and width.
Endpoint for images with crops and width, format transformation and file name.
Endpoint for generic media files.
Endpoint for images with crops and width
The first endpoint to request images provides access to all existing crops plus its width. The structure of the URI template is as follows:
/caas/v1/media/{mediaId}/{propertyName}/{hash}/{cropName}/{width}</code>
Crop name and width can be retrieved along with the query for the
uriTemplate
and must replace the placeholders 'cropName' and 'width'.
Trying to request non-existing crop names or width will result in an HTTP 404 Not Found Error
.
Endpoint for images with crops and width, format transformation and file name
The second endpoint to request images additionally supports on-the-fly image format transformation and the original file name. The structure of the URI template is as follows:
/caas/v1/media/{mediaId}/{propertyName}/{hash}/{cropName}/{width}/{filename}
The supported image formats can simply be chosen as one of the supported image formats 'jpg', 'jpeg', 'png' and 'gif'.
Requesting an unsupported format, for example, 'webp' will result in an HTTP 400 Bad Request Error
.
Endpoint for generic media files
The third endpoint is the most generic. It provides access to any media file which is managed by the CMS. The structure of the URI template is as follows:
/caas/v1/media/{mediaId}/{propertyPath}/{hash}[/{filename}]
Note that the filename
is optional.
You can comfortably explore the described endpoints using the Swagger UI provided with the overview page.
Content Disposition Header
Whenever a media file is requested with its correct filename (incl. suffix), the HTTP header
Content-Disposition
will be set to inline; filename=<the-original-file-name>
.
Placeholders of the media endpoints
- mediaId
The content ID of the media/picture.
- propertyName
The name of the property, where the blob is stored, usually
data
.- propertyPath
The name of the property where the blob is stored or the full property path, in case the blob ist stored in a struct.
- hash
The hash of the blob. Usually queried via GraphQL.
- cropName
A name of an existing crop for a blob. Usually queried via GraphQL.
- width
An existing width belonging to the crop name. Usually queried via GraphQL.
- filename
The file name of a media file, incl. its suffix. Usually queried via GraphQL.