close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2406.1

Table Of Contents

12. Media Endpoint

The 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 alternative image format


{
  content {
    picture(id: "1904") {
      id
      name
      data {
        uri
      }
      fullyQualifiedUrl
    }
  }
}

Example 12.3. Retrieving the URI or the fully qualified URL of the original file of a picture


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.