close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2512.0

Table Of Contents

11. 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 11.1. Retrieving the URI template of a picture


{
  content {
    picture(id: "1904") {
      id
      name
      uriTemplate(imageFormat: PNG)
      crops {
        name
        sizes {
          width
        }
      }
    }
  }
}

Example 11.2. Retrieving the URI template of a picture with an alternative image format


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

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


It is important to note that the URLs accepted by the media endpoint (blob delivery) should always match the urls retrieved via GraphQL (link building). The link building is performed by Link Composers and Adapters and then woven into the GraphQL schema using the fetch directive to invoke the named bean uriLinkComposer. Fore details about Link Composers and Adapters please refer to the corresponding sections ??? and Section 4.8, “Adapter”.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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