Headless Server Developer Manual / Version 2110
Table Of ContentsThe media endpoint provides access to all media files (blobs), managed by the CMS. The endpoint supports image transformation in terms of precalculated crop sizes and supported image formats (see Section 9.5.3, “Image Cropping and Image Transformation” in Studio Developer Manual for details about crops). The URL to a managed media file is usually retrieved by means of a GraphQL query.
The following examples show, how you retrieve the URL of images and media files via a GraphQL query.
{ content { picture(id: "1904") { id name uriTemplate crops { name sizes { width } } } } }
Example 12.1. Retrieving the URI template of a picture
{ content { picture(id: "1904") { id name uriTemplate(imageFormat: PNG) crops { name sizes { width } } } } }
Example 12.2. Retrieving the URI template of a picture with an image format
{ content { picture(id: "1904") { id name data {uri} } } }
Example 12.3. Retrieving the URI template of any media file