Retrieve all rails and related content for a template
Description
This API returns all the rails of the requested template, and will retrieve the related data for each section of the rail from the specified locations, e.g., nodes, recommendation engines, etc.
Request
To retrieve all the rails for a particular template, send a GET request to:
https://server:port/contentdelivery/v1/templateviews/{templateid/templatename}
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.
To be able to see contents it is required that at least one rail has been added to a layout and at least one rail item has been added to the rail.
Headers
Authorization: Bearer
– bearer tokenContent-Type: application/json
Nagra-Target
– the device type (e.g.,TV
)Accept-Language
– the locale (e.g.,en_GB
)
Mandatory arguments
{templateid/templatename}
– the client must pass either a template ID or a template name (both are unique) to retrieve the specific template’s rails and their content (in URL).
Response
A successful request returns an HTTP 200 status. The response includes 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
{
"name": "westerns",
"title": "Yee Haw!",
"properties": {
"background-image": "/IM/cowboy_background.jpg"
},
"targets": [
"ios",
"Android"
],
"rails": [
{
"name": "best",
"title": "Best of Westerns",
"layout": "landscape",
"properties": {
"play-trailers-on-hover": "true"
},
"sections": [
{
"type": "ContentItem",
"properties": {
"size": "promoted"
},
"content": [
{
"type": "editorial",
"id": "GLOBAL_gbu",
"Title": "The Good, the Bad and the Ugly"
}
]
},
{
"type": "NodeItem",
"properties": {
"size": "standard"
},
"content": [
{
"type": "editorial",
"id": "GLOBAL_ffd",
"Title": "A Fistful of Dollars"
},
{
"type": "editorial",
"id": "GLOBAL_ffdm",
"Title": "For a Few Dollars More"
},
{
"type": "editorial",
"id": "GLOBAL_u",
"Title": "The Unforgiven"
},
{
"type": "editorial",
"id": "GLOBAL_ncfom",
"Title": "No Country for Old Men"
}
]
},
{
"type": "PreCuratedItem",
"properties": {
"size": "jumbo"
},
"source": "AMCO",
"content": [
{
"type": "editorial",
"id": "GLOBAL_tc",
"Title": "Thundercats",
"images": [
{
"name": "medium_16_9",
"aspectRatio": "16:9",
"height": 480,
"width": 720,
"uri": "https://m.media-amazon.com/images/M/MV5BMjJhNjMzNzYtMzIwYy00OGQ5LWE0NWMtNWJkNWE3NmMwNDJkL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyNDUxNjc5NjY@._V1_.jpg"
}
],
"links": [
{
"provider": "AMCO",
"type": "vod",
"action": "direct",
"uri": "https://amco.com/thundercats_ho!"
}
]
}
]
}
]
}
]
}
See also
For full details of this API, see the Content Delivery API documentation.