Overview
A client application needs to read the response it receives from Content Delivery and render each screen and the rails that it contains according to the contents of the response.
This page explains:
-
Basic rails concepts
-
The structure of the template and rail responses
-
The fields that are returned and how this affects what the client should display
Together with Rails responses – instances, it lays out the expected rails functionality that is expected to be supported by an OpenTV ENTera partner client application.
Basic rails concepts
Templates and layouts
A template represents a page in your application. For example, there may be a template for each of the following
-
Home screen
-
Movies screen
-
Guide (EPG) screen
-
Explore screen
Each template can have one or more layouts. For example, it might have:
-
One layout for each destination:
tv,mobile,tablet, anddesktop -
A single (default) layout that applies to all possible destinations.
-
One or more layouts that apply to one or more destinations and a default layout for destinations that are not covered by a specific layout
For example, you could have one layout that applies only tomobileand a default layout that will be used for all other destinations.
When a client requests templates, it specifies its destination type in the request and Content Delivery returns the layout for each template that matches the specified destination.
Rails and rail sections
A rail can consist of one or more rail sections. For example, a single rail could contain the following sections:
-
A promotional banner
-
Three curated content items
-
Five recommended content items
Although these are added to the rail as three sections in OpCon, the response that you receive from Content Delivery will simply include nine section blocks, one for each item that the client needs to render in the rail.
Blueprints
A blueprint defines a type of strip (rail). It includes a set of parameters that define how a rail that is based on it should be presented.
Each defined blueprint can have one or more instances, each of which defines a specific version of the blueprint.
For example, there is a predefined blueprint called Magazine Strip. And there are predefined instances of Magazine Strip called Large Poster Magazine and Hero Magazine 1.
Similarly, for the predefined blueprint type called Promotional Strip, there are instances called Single Promotion: 3:1 Dual Height Row and Double Promotion: 4:1 Dual Height Row.
When a rail is created, it is based on an instance of a blueprint, that is, one of the following:
-
A predefined instance of a predefined blueprint
-
A custom instance of a predefined blueprint
-
A predefined instance of a custom blueprint
-
A custom instance of a custom blueprint
-
No blueprint at all (legacy rail)
Custom components
A custom component is a component with specific functionality that can be added to a rail. For example:
-
An ad banner
-
An application launcher
-
A feature banner
Each of these items, when included in a rail response, includes the target that the client should navigate to if the user clicks or taps the item:
-
For an ad banner, the ad server URL
-
For an app launcher, the platform-specific package ID
-
For a feature banner, the ID of the template (page in the client app) to be navigated to
Key/value pair groups
A key/value pair group is a common configuration element that can be used to extend the definition of a rail/strip.
As with blueprints, there are both key/value pair groups and specific instances of each key-value pair group.
After a rail has been created, one or more key/value pair group instance can be added to it.
For example, there are predefined key/value pair groups for:
-
Branding – includes an image and a brand name for adding branded elements to a rail/strip
-
Logo (rail) – includes a logo image that the client should add to the rail
-
Logo (content) – includes a logo image for content and fields that indicate the positioning and opacity of the logo
-
Android Channels API – includes a setting that maps content to Android TV’s native channel system
Note that a rail/strip with an instance of this key/value pair group will not usually have any content – it will be populated by channels from the Android Channels API.
Note that you can only add an instance of a key-value pair group to a specific rail. You cannot add one to a blueprint or blueprint instance.
Ad-hoc key/value pairs
In addition to key/value pair groups, a rail can have ad-hoc key/value pairs. These are referred to as Additional Properties in the OpCon UI.
Ad-hoc key/value pairs were typically used to provide client applications with details about how to render rails before blueprints existed.
Typical call flow
Typically, the client will need to make several calls to get all the information it needs to render the different pages that make up its interface and the rails within each page:
-
Call
GET https://<host>:<port>/contentdelivery/v1/templateviews/hierarchyto get the hierarchy of templates that represent the various screens. -
For each page/template, call
GET https://<host>:<port>/contentdelivery/v1/templatesummary/{templateId}to get the rails that make up the page (without their contents). -
For each rail on the page, call
GET https://<host>:<port>/contentdelivery/v2/templateviews/{templateId}/rails/{railId}?limit=10to get the rail contents and metadata.
You are recommended to use thelimit,page, andoffsetparameters to load only enough rail items to fill the visible part of the rail and the first part that the user will see if they scroll horizontally, and only load more if they do scroll.
See Best practices – rails.
When you make a request to Content Delivery, you should include the destination (e.g., tv or mobile) in the Nagra-Target header. Content Delivery returns the appropriate layout for that destination.
You must also include the device type (e.g., Android or iOS) in the Nagra-Device-Type header. This ensures that the rails that Content Delivery returns reference the correct technical contents (e.g., an HLS technical for iOS or a DASH technical for Android).
Rail fields
The following tables explain the fields that are returned when you make a rail request for each type of blueprint, custom component, and key/value pair group.
For the specific values that are returned for each instance of a blueprint or key/value pair group, see Rails responses – instances.
Differences between template and rail responses
The differences between a template response and a rail response are as follows:
-
sectionsblock:-
In a template response, this is always an empty array.
-
In a rail response, it contains the actual rail contents and metadata.
-
-
hasNext:-
In a template response, this is always
null. -
In a rail response, it has a value of
trueorfalseto indicate whether more content is available.
-
-
sessionblock – not present in template response.
Both templates and rails can have blueprints applied to them. Blueprints at the template level are a legacy feature.
Common fields
The following table lists the fields that are not specific to blueprints, custom components, or key/value pair groups:
|
Field |
Description |
Availability (template or rail) |
Value/present |
Meaning/actions |
|---|---|---|---|---|
|
|
The name of the rail |
Both |
Always present (mandatory) |
The client should display this as the title of the rail if |
|
|
The rail title |
Both |
May be present or |
If |
|
|
The default image orientation |
Both |
Either |
Use this value for all rails in the layout, unless:
|
|
|
Other properties for the rail |
Both |
Zero or more key/value pairs |
Typically used to instruct the client on how to present the rail before blueprints were introduced. |
|
|
The sections that the rail includes. In a template response, this is always an empty array. |
Rail (present in template response, but always an empty array) |
N/A |
To get the actual contents of the rail, you must make a get rail request. In the rail response, the |
|
|
Whether there is more content available for the rail. In a template response, this is always |
Rail (present in template response but always |
N/A |
To get the actual contents of the rail, you must make a get rail request. In the rail response, the |
|
|
The ID of the rail |
Both |
Always present |
No action required |
Blueprints
The following fields are all within the configurationProperties block.
Standard strip
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The
|
|
|
static |
|
The
|
|
|
enum selector (duplicates on, re-ordering on) |
|
The
Examples:
|
|
|
boolean |
|
The
Notes:
|
|
|
numeric (0 to 1000) |
|
The
The If Example Usage:
|
|
|
boolean |
|
The
|
Magazine strip
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The
|
|
|
enum |
|
The
|
|
|
enum selector (duplicates on, re-ordering on) |
|
The
Examples:
|
|
|
boolean |
|
The
|
|
|
enum |
|
The
|
|
|
boolean |
|
The
|
|
|
boolean |
|
The
Notes:
|
|
|
numeric (0 to 1000) |
|
The
The If Example Usage:
|
|
|
boolean |
|
The
|
Promotional strip
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The A promotional_strip rail is designed to highlight featured or time-sensitive content, such as special offers, exclusive releases, or marketing-driven material/advertisements. This type of rail may be visually distinct, include attention-grabbing elements, or allow for dynamic content updates based on promotional cycles. These are designed to work in conjunction with |
|
|
enum |
|
The
|
|
|
boolean |
|
The
Carousels are ideal for highlighting specific content, ensuring that the user’s attention is drawn to a select few items within the strip. Notes:
|
|
|
enum selector (duplicates on, re-ordering on) |
|
The
Examples:
|
|
|
boolean |
|
The
|
Custom components
The following fields are all within the configurationProperties block.
Application
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
Defines the type of the rail item. An |
|
|
string |
|
The |
|
|
hex colour |
|
Specifies a background colour for the application tile. |
|
|
string |
|
The package ID used to reference the application on Android TV STBs. Example: |
|
|
string |
|
The identifier for referencing the application on Linux-based STBs. |
|
|
string |
|
The package ID for referencing the application on Android mobile devices. Example: |
|
|
string |
|
The bundle ID for referencing the application on iOS devices. |
|
|
string |
|
The ID for redirecting to the app store in the scenario that the application is not installed on iOS devices. |
|
|
string |
|
The identifier for referencing the application on integrated Linux-based environments. |
Pre-installed application
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
Defines the type of the rail item. An |
|
|
string |
|
The |
|
|
hex colour |
|
Specifies a background colour for the application tile. |
|
|
string |
|
The package ID used to reference the application on Android TV STBs. Example: |
|
|
string |
|
The identifier for referencing the application on Linux-based STBs. |
|
|
string |
|
The package ID for referencing the application on Android mobile devices. Example: |
|
|
string |
|
The bundle ID for referencing the application on iOS devices. |
|
|
string |
|
The ID for redirecting to the app store in the scenario that the application is not installed on iOS devices. |
|
|
string |
|
The identifier for referencing the application on integrated Linux-based environments. |
Feature banner
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
Defines the type of the rail item. A |
|
|
template selector |
|
When |
When using a feature banner within a rail, the rail must also have a key/value pair section to specify the display image to be used (either Internal image or External image (see below).
Promotional banner
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
Defines the type of the rail item. A |
|
|
string |
|
The URL to direct the user to on interaction |
When using a promotional banner within a rail, the rail must also have a key/value pair section to specify the display image to be used (either Internal image or External image (see below).
Advertisement Banner
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
Defines the type of the rail item. An |
|
|
string |
|
The This URL serves as the endpoint for fetching the ad creative and other relevant details (e.g., targeting parameters, ad placement information) and ensures that the client connects to the appropriate ad server for content delivery. |
Key/value pair groups
The following fields are all within the configurationProperties block.
Logo configuration (rail)
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The |
When applying a logo configuration (rail) KVP group to a rail, the rail must also have a key/value pair section to specify the display image to be used (either Internal image or External image (see below).
Logo configuration (rail content)
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The |
|
|
enum |
|
The
|
When applying a logo configuration (rail content) KVP group to a rail, the rail must also have a key/value pair section to specify the display image to be used (either Internal image or External image (see below).
Client-side processing
This is a marker to indicate to the client they should render the contents on the client side, fetching more data as needed. Each app implementation may have bespoke components with this behaviour. If the app does not have code to handle this item it should ignore it entirely.
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The The clientside type serves as a marker indicating that the rail requires bespoke processing either in addition to, or instead of, that of a standard rail. Depending on the requirements, these special rails:
This allows for greater flexibility in content presentation, filtering, and personalisation based on user interactions, preferences, or local device conditions. Unlike static rail types that retrieve and display predefined content, clientside enables real-time modifications without requiring back-end updates. It can be used for features such as dynamically generated recommendations, locally cached content, or interactive filtering within a rail. |
|
|
string |
|
The |
|
|
array (string) |
|
The |
Internal image
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The The |
|
|
enum |
|
The
|
|
|
string |
|
The reference to an internal image stored within the platform’s image service. This is the default image for the |
|
|
string |
|
The For localisation, use the format |
External image
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The The |
|
|
enum |
|
The
|
|
|
numeric (-100 to +100) |
|
Values other than 0 mean the client must provide the specified level of scaling on the image. |
|
|
image |
|
Specifies the direct URL to an externally hosted image. This is the default image for the |
|
|
string |
|
The For localisation, use the format |
Android Channels API
|
Keys |
Type |
Values |
Description |
|---|---|---|---|
|
|
static |
|
The The android_channels_api type serves as a marker indicating that the content for this rail should be sourced dynamically using the Android Channels API rather than being predefined within the back-end. The Android Channels API is part of the Android TV home screen experience, allowing apps to create and manage custom content channels (rails) that integrate seamlessly with the launcher. While the layout and structure of the rail can still be configured within the blueprint, the actual content population is controlled by the client through API calls. This enables flexible, real-time updates to live TV, on-demand content, or personalised recommendations, aligning with the Android TV user experience. |
|
|
string |
|
This field specifies the package name of the Android app associated with the set-top box (STB) that is calling the Android Channels API. The package name is a unique identifier for the app on the Android platform, ensuring that the correct app is referenced when interacting with the API. For example, for Amazon Prime Video on Android TV, the package name would be |