OpenTV ENTera & OpenTV Platform Documentation

Retrieve all templates with child template IDs

Description

This API returns a list of available scheduled templates for the requested device. The client will be able to retrieve all available templates that are in the current schedule. The response will return a list of templates along with a list of the child template IDs for each 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. 

The template hierarchy is provided through the IDs of any child/parent templates.

An alternative API is available that provides the hierarchy as the full structure of related templates. 

Request

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

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

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 returns a response like this:

{
  "templates": [
    {
      "id": "123",
      "name": "ChristmasTemplate",
      "title": "Christmas",
      "children": [
        "456"
      ],
      "properties": {
        "prop1": "val1"
      }
    },
    {
      "id": "456",
      "name": "ChristmasKidsTemplate",
      "title": "Christmas Kids",
      "parent": "123",
      "children": [
        "789"
      ],
      "properties": {
        "prop1": "valAbc",
        "prop2": "valXyz"
      }
    },
    {
      "id": "789",
      "name": "BoxingDayKidsTemplate",
      "title": "Boxing Day Kids",
      "parent": "456",
      "children": []
    }
  ],
  "totalRecords": 3
}

See also

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