Feed API
DS Output Doc Guide
The structure of the model
{
"type": {
"value": "feed"
},
"title": "<TITLE>",
"entry": [
{
"type": {
"value": "<article/link/imageGallery/video/image/playlist/feed/channel/program>"
},
"id": "<ID>",
"title": "<TITLE>",
"summary": "<SUMMARY>",
"published": "<PUBLISH DATE - ISO8601>",
"updated": "<UPDATE DATE - ISO8601>",
"author": {
"name": "<AUTHOR NAME>"
},
"media_group": [
{
"type": "<IMAGE/VIDEO/AUDIO>",
"media_item": [
{
"src": "http://your.link.here.com",
"key": "<IMAGE KEY 1>",
"type": "<image/video/audio>"
},
{
"src": "http://another.link.here.com",
"key": "<IMAGE KEY 2>",
"type": "<image/video/audio>"
}
]
},
{
"type": "<IMAGE/VIDEO/AUDIO>",
"media_item": [
{
"src": "http://your.link.here.com",
"key": "<IMAGE KEY 1>",
"type": "<image/video/audio>"
},
{
"src": "http://another.link.here.com",
"key": "<IMAGE KEY 2>",
"type": "<image/video/audio>"
}
]
}
],
"content": {
"type": "<DESCRIBED BELOW>",
"src": "<DESCRIBED BELOW>",
"content": "<DESCRIBED BELOW>"
},
"link": {
"type": "<DESCRIBED BELOW>",
"rel": "<DESCRIBED BELOW>",
"href": "<DESCRIBED BELOW>"
},
"extensions": {
"expires_at": "2017/06/15 03:05:00 +0000",
"header_action_url": "<URL Scheme>",
"<Custom Key 1>": "<Custom Value 1>",
"<Custom Key 2>": false,
"<Custom Key 3>": {
"Inner Key 1": true,
"Inner Key 2": "String",
"Inner Key 3": 1
}
}
}
]
}
Description of the fields
ID - required
Unique identifier string
Type - required
The entry
element MUST be added and its value attribute MUST be set to one of the following:
- For Article use:
"type": { "value": "article" }
- For Video (HLS or YouTube) use:
"type": { "value": "video" }
- For Image-Gallery:
"type": { "value": "imageGallery" }
- For Image use:
"type": { "value": "image" }
- For Link use:
"type": { "value": "link" }
- For Playlist use:
"type": { "value": "playlist" }
- For Program use:
"type": { "value": "program" }
- For Channel use:
"type": { "value": "channel" }
- For Feed use:
"type": { "value": "feed" }
Title
The title
element represents the title of the entry.
Summary
If added, the field will be visible for the end user.
Link
If a link element exists and its
rel
attribute is set toalternate
and itstype
attribute is set totext/html
, the href value of the link will be used as the shared link URL of the entry."link": { "type": "text/html", "rel": "alternate", "href": "<SHARED LINK URL>" }
If a link element exists and its
rel
attribute is set toself
and the entry type islink
, thehref
value of the link will be used as a link to the article."link": { "rel": "self", "href": "<LINK OF THE ENTRY>" }
If using entry type feed|imageGallery
the link
element href value of the link will be used for loading the nested feed.
Note: If the nested feed should be using a custom data source provider, the url should be constructed as follows:
<custom_provider_scheme>://fetchData?type=<provider_data_type>&url=<original_feed_url>
Published
If added, the field will be visible for the end user. It should follow ISO8601.
Updated
If added, the field will be visible for the end user. It should follow ISO8601.
Content
The content element type attribute depends on the Entry type:
- For Article use
html
- For Image use one of the following types:
image/png
,image/gif
,image/jpg
,image/jpeg
- For Video use
video/hls
- For YouTube Video use
youtube-id
- For Image-gallery use
application/atom+xml
- Article type MUST contain the escaped embedded HTML markup within. Any HTML tags that do not belong to the list
<p>, <a>, <strong>, <h2>, <h3>, <h4>, <h5>, <img>
aren't recommended and can cause bad article formatting - Image type MUST have a
src
attribute with the link to the full sized image - Image-gallery type MUST have a
src
attribute with the link to an Applicaster Atom Feed that holds image entries with an element set toimage
- Entries without it will be discarded
- YouTube Video type MUST have a src attribute with the YouTube video ID.
- For feed, use type feed. The feed type MUST contain a src attribute with a link for fetching the data
Applicaster media group
The media_group
element groups media assets from the same type. The supported group types are below:
- image: an image that will be used when showing the item in a collection view
- detailed-view: relevant only for articles. It holds the item image of the article in full view mode
- video: relevant only for articles. It holds the item video of the article.
- audio: relevant only for articles. It holds the item audio of the article.
Applicaster media item
The media_item
element MUST be contained inside a media_group
element.
- type: the type of the media item. It can be one of the following: image, audio, video.
- src: the URL of the media item
- key: differentiates the media items in the media group
Extensions
- Used for client-specific fields
- Keys are of String type
- Values are of ANY type
expires_at
This field, under the extensions object, defines the time in which the component that holds this Feed as a datasource needs to be refreshed. For example, if your Feed contains a program which ends in 30 minutes and you want to remove this program from the screen after it is over, the provider can define the expires_at
value to be 30 minutes from the current time (a date formatted string with this format "yyyy/MM/dd HH:mm:ss Z"
). Then the component will trigger the provider's load method again when the time comes.
free
The free
key can be defined on the extensions object to indicate whether an item is free or not. The value can either be a String representation of a Boolean (true/false) or a Boolean. If the extension key is not defined or an invalid value was supplied, the default behavior is for the item to be treated as free.
video_ads
The datasource can provide information about video ads to display with the video item. The video ads configuration will be handled by the video player if it supports displaying video ads and implements this protocol. To learn more about the optional protocol to integrate video ads into the extensions section, click here.
text_tracks
The datasource can provide information about text tracks (captions / subtitles) to display on top of the video. The text tracks configuration will be handled by the video player if it supports displaying text tracks and implements this protocol. To learn more about the optional protocol to integrate text tracks into the extensions section, click here.
Header action URL
Override the default behavior when clicking on a header item. The header_action_url
key must be defined under the extensions object, the value must be the URL SCHEME
to run
applicaster_channel_id
When this field is present on a channel/program entry, we override the content src and use it to load and play the channel from Applicaster 2. We will use the default behavior of playing the content src otherwise.
channel_branding
Provides information about the channel brand
in the Atom Channel in order to display a livestream. For example the channel BBC
can have branding BBC1
, BBC2
, etc. However, many times a single channel has single branding.
Examples
Feed
{
"type": {
"value": "feed"
},
"title": "<OPTIONAL>",
"id": "< OPTIONAL >",
"summary": "< OPTIONAL >",
"published": "< OPTIONAL >",
"updated": "< OPTIONAL >",
"author": {
"name": "< OPTIONAL >"
},
"media_group": [OPTIONAL],
"link": {OPTIONAL},
"extensions": {OPTIONAL},
"entry": [] // Atom Entries
}
Video Entry
{
"entry": [
{
"type": {
"value": "video"
},
"id": "Id1",
"title": "Example Video Title #1",
"summary": "Example summary",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
}
],
"content": {
"type": "video/hls",
"src": "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
}
}
]
}
Image Gallery Entry
{
"entry": [
{
"type": {
"value": "imageGallery"
},
"id": "Id1",
"title": "Example Video Title #1",
"summary": "Example Image Gallery Title #1",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
}
],
"content": {
"type": "application/atom+xml",
"src": "http://media.example.org/example-image-gallery.xml"
}
}
]
}
Article with Video Entry
{
"entry": [
{
"type": {
"value": "article"
},
"id": "Id1",
"title": "Example Article Title #1",
"author": {
"name": "Author Name"
},
"link": {
"rel": "alternate",
"href": "http://www.example.com/article1.html",
"type": "text/html"
},
"summary": "Example Video Article Title #1",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
},
{
"type": "video",
"media_item": [
{
"src": "http://techslides.com/demos/sample-videos/video.mp4",
"type": "video"
},
{
"src": "http://example.org/image-large.png",
"key": "large",
"type": "image"
},
{
"src": "http://example.org/image-small.png",
"key": "small",
"type": "image"
}
]
}
],
"content": {
"type": "html",
"content": "<some html content>"
}
}
]
}
Article with Audio Entry
{
"entry": [
{
"type": {
"value": "article"
},
"id": "Id1",
"title": "Example Article Title #1",
"author": {
"name": "Author Name"
},
"link": {
"rel": "alternate",
"href": "http://www.example.com/article1.html",
"type": "text/html"
},
"summary": "Example Audio Article Title #1",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
},
{
"type": "audio",
"media_item": [
{
"src": "http://www.sample-videos.com/audio/mp3/wave.mp3",
"type": "audio"
},
{
"src": "http://example.org/image-large.png",
"key": "large",
"type": "image"
},
{
"src": "http://example.org/image-small.png",
"key": "small",
"type": "image"
}
]
}
],
"content": {
"type": "html",
"content": "<some html content>"
}
}
]
}
Article with Image Entry
{
"entry": [
{
"type": {
"value": "article"
},
"id": "Id1",
"title": "Example Article Title #1",
"author": {
"name": "Author Name"
},
"link": {
"rel": "alternate",
"href": "http://www.example.com/article1.html",
"type": "text/html"
},
"summary": "Example Audio Article Title #1",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
},
{
"type": "detailed-view",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
}
],
"content": {
"type": "html",
"content": "<some html content>"
}
}
]
}
Program
{
"entry": [
{
"type": {
"value": "program"
},
"id": "id1",
"title": "Example Program Title #1",
"author": {
"name": "Author Name"
},
"link": {
"rel": "alternate",
"href": "http://www.example.com/program.json",
"type": "application/json"
},
"summary": "Example Program #1",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"src": "http://example.org/image-large.png",
"key": "image_base",
"type": "image"
}
]
},
],
"content": {
"type": "video/hls",
"src": "<stream url to play>"
},
"extensions": {
"start_time": "2017/06/15 01:05:00 +0000",
"end_time": "2017/06/15 03:05:00 +0000",
"applicaster_channel_id": "100"
}
}
]
}
Channel Entry
{
"entry": [
{
"type": {
"value": "channel"
},
"id": "Id1",
"title": "Example channel Title #1",
"summary": "Example summary",
"published": "2005-04-06T13:00:00-08:00",
"updated": "2005-04-06T20:25:05-08:00",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
}
],
"content": {
"type": "video/hls",
"src": "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
},
"extensions": {
"applicaster_channel_id": "100"
}
}
]
}
Link Entry
{
"type": {
"value": "link"
},
"id": "id1",
"title": "Example Link Title #1",
"summary": "Example summary",
"media_group": [
{
"type": "image",
"media_item": [
{
"type": "image",
"key": "image_base",
"src": "http://example.org/image-large.png"
}
]
}
],
"link": {
"href": "URL",
"type": "link"
}
}