Skip to main content
Skip table of contents

Retrieve all templates with all their child templates

Description

This API returns a list of available templates for the requested device. The client will be able to retrieve all available templates that are in the current schedule. The response will include a list of templates along with each one's child template. No rails information is returned.

An example of a parent and child template might be where a template has been set up to cater for the whole Christmas period, but where a child template also exists to deliver content specifically on Christmas Day. 

Hierarchy is provided as the full structure of related templates.

An alternative API is available that provides the structure through the IDs of any child/parent templates. 

Request

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

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

Preconditions

The operator should have created the templates and their layouts. They also need to schedule templates for the current time to be able to retrieve this list. If a template doesn’t have a scheduled layout for the current time, the API won’t be able to retrieve it.

Headers

  • Authorization: Bearer – bearer token

  • Content-Type: application/json

  • Nagra-Target – the device type (e.g., TV)

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

Response

A successful request returns an HTTP 200 status. The response contains a list of templates and the number of templates.

An unsuccessful request returns an HTTP 500 status if there was a problem with the request.

Example

A successful request will return a response like this:

CODE
{
  "templates": [
    {
      "id": "123",
      "name": "ChristmasTemplate",
      "title": "Christmas",
      "children": [
        {
          "id": "456",
          "name": "ChristmasKidsTemplate",
          "title": "Christmas Kids",
          "children": [
            {
              "id": "789",
              "name": "BoxingDayKidsTemplate",
              "title": "Boxing Day Kids",
              "children": []
            }
          ],
          "properties": {
            "prop1": "456_valAbc",
            "prop2": "456_valXyz"
          }
        }
      ],
      "properties": {
        "prop1": "123_val1"
      }
    }
  ]
}

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.