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:
https://server:port/contentdelivery/v1/templateviews/hierarchy
Headers
Authorization: Bearer– bearer tokenContent-Type: application/jsonNagra-Target– the destination (e.g.,TV). This determines the template layout that is returned. (A layout can have a destination of oftv,mobile,tablet, and/ordesktop, or all of these.)Nagra-Device-Type– the device type (e.g.,AndroidoriOS). 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-agehas passed.Should refresh the data by making another request if the time specified in
max-agehas passed.
See Caching best practices for more details.
Example
A successful request will return a response like this:
{
"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.