Skip to main content
Skip table of contents

Retrieve the template hierarchy

Overview

This endpoint returns the hierarchy of available templates for the requested device, that is, a list of templates along with each one's child templates (if any). No rail information is returned.

Request

To retrieve all the available templates with their child templates, send a GET request to:

BASH
https://server:port/contentdelivery/v1/templateviews/hierarchy

Headers

  • Authorization: Bearer – bearer token

  • Content-Type: application/json

  • Nagra-Target – the destination (e.g., TV). This determines the template layout that is returned. (A layout can have a destination of of tv, mobile, tablet, and/or desktop, or all of these.)

  • Nagra-Device-Type – the device type (e.g., Android or iOS). This determines the technicals that are are returned in rails responses.

  • Accept-Language: the locale (e.g., en_GB)

Response

A successful request returns an HTTP 200 status.

A bad request returns an HTTP 400 status.

See Template hierarchy responses for details about the response.

The response includes a cache-control header that specifies a max-age.

The client must respect this. That is, it:

  • Should not repeat the same request until the time specified in max-age has passed.

  • Should refresh the data by making another request if the time specified in max-age has passed.

See Caching best practices for more details.

Example

A successful request will return a response like this:

JSON
{
  "templates": [
    {
      "id": "123",
      "name": "ChristmasTemplate",
      "title": "Christmas",
      "properties": {},
      "children": [
        {
          "id": "456",
          "name": "ChristmasKidsTemplate",
          "title": "Christmas Kids",
          "properties": {},
          "children": [
            {
              "id": "789",
              "name": "BoxingDayKidsTemplate",
              "title": "Boxing Day Kids",
              "properties": {},
              "children": []
            }
          ]
        }
      ]
    }
  ]
}

Note that the properties that are returned for each template are the ones defined on the current active layout, and not the properties of the template.

See also

For full details of this API, see the Content Delivery API documentation.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.