SimpleItem
The SimpleItem object is the one returned by all recommendation requests to the New-style API. It is essentially the same as the already existing SimpleMovie object in UNIAPI, with a few small differences:
- Two fields, Views (Number of times the content has been watched) and AgeRating (age classification) have been removed from the object, due to both computational and design/commercial reasons.
- The RequiresPin and AvailableForThisDevice fields have also been removed (availability information is fetched when entering the item details page).
- The field Source can be present to indicate the source of recommendations.
- The field ItemData and EditorialUrl includes some extra information that will be interpreted by devices.
The SimpleItem object contains the following fields:
Field | Type | Required | Description |
---|---|---|---|
ID | Integer | Yes | Numeric identifier of the item. It is a GVP content ID. |
Title | String | Yes | Content title. |
Type | MovieType enum | Yes | Type of the content. |
Duration | Integer | Yes | Content duration in seconds. |
ResizableImages | Array of Image objets | Yes | List of original images. |
Stars | Float | Yes | Overall rating computed by the Recom Engine. It is returned when it can be obtained. If, for any reason, it cannot be retrieved, this field is not included in the SimpleItem object. |
Year | Integer | Yes | Release year of the content in the GVP catalog. It is returned when it can be obtained. If, for any reason, it cannot be obtained, this field is not included in the SimpleItem object. |
Hd | Boolean | Yes | Signals if a High Definition (HD) version of the content is available. It is returned when it can be obtained. If, for any reason, it cannot be obtained, this field is not included in the SimpleItem object. |
ShortDescription | String | Yes | Content blurb, (only for editorial content). Likely only for editorial content, since it is the only type of content whose placement in the client allows space for rendering it. It is returned when it can be obtained. If, for any reason, it cannot be obtained, this field is not included in the SimpleItem object. |
Source | Source enum | Yes | Source the recommended item comes from. It will be present only in result lists of SimpleItem objects that mix different sources. |
DateStart | Integer | Yes | License Start in Unix Timestamp. It can be used to determine if the content is new in the catalog. |
DateEnd | Integer | Yes | License End in Unix Timestamp. It can be used to determine if the content is close to be unavailable. |
Distributor | String | Yes | Title of the content distributor. If the CommercializationTypeId is equals to 1 (Catchup) this field is the Call Letter of the Linear TV Channel where the content was originally broadcasted. |
CommercializationTypeId | CommercializationType enum | Yes | ID of commercialization type. |
ItemData | JSON | Yes | Data loaded by OB for editorial recommendations. This field is not processed by OpenGVP and it is interpreted directly by devices. It usually is an image data of type “banner”. |
EditorialUrl | String | Yes | URL loaded by OB for editorial recommendations. This field is not processed by OpenGVP and it is interpreted directly by devices. It usually is the link to jump when a click over the editorial recommendation banner is done on the UI. |
Subscriptions | String | Yes | New in 3.2. SubscriptionIDs where the item is available |
All required data, except Source, Stars, ItemData and EditorialUrl are retrieved from GVP Backend API through the next operations:
/Data/Movie/<product_id_list>/filters/MetadataLanguage/<language_id> /Data/Image/<image_id_list>
For sources equals to Popular, Highly Rated and Personal, SimpleItem objects can represent exclusively movies (Type = 1) and TV series (Type = 2).
SimpleItem Object for Editorial Recommendations
SimpleItem objects for Editorial Recommendations can represent:
- Promotions related to a content:
- Movies (Type = 1)
- TV series (Type = 2)
- Seasons (Type = 3)
- Episodes (Type = 4)
- Promotion not directly related to a content:
- Subscriptions
- Playlist
- Detached banners (image not associated to any GVP Product)
- Etc.
SimpleItem objects for editorial recommendations related to contents are composed by the same fields that a regular recommendation and, additionally, it contains the ItemData and EditorialUrl fields (their value are always null for values 1, 2 and 3 in "sources" input parameter). These extra fields are used to hold all data introduced by a human operator to configure the editorial recommendation through the MiB web tool.
SimpleItem objects for editorial recommendations not directly related to contents are composed by:
- Only ID, Type, Source (if is not implicit in the method) and ItemData (optional) fields are returned.
- ID and Type are set to 0.
- ItemData field contains all data introduced by a human operator to configure the editorial recommendation through the MiB web tool. The client application must interpret this data to display properly the editorial recommendation on the screen.
- ItemData JSON object cannot be empty and inside if the Url field cannot be empty. SimpleItem objects with empty ItemData or empty Url are discarded because they cannot be displayed by client applications.
- EditorialUrl can be set to an empty or non-empty string.
Next is an example of a SimpleItem that represent a correct editorial recommendations not directly related to a content.
{ "Type": 0, "ID": 0, "ItemData": { "Url": "http://gvp.dev4.storage.s3.amazonaws.com:80/IMAGES/00/00/01/19140_60C6F49707EC84C8.jpg", "Width": 1024, "Type": 3, "ID": 19140, "Height": 768 }, "EditorialUrl": “http://server:port/path/page.htmel” }
Next are examples of a not valid SimpleItem to represent editorial recommendations not directly related to a content. They will never be included in the response of a new style Recommendation API method.
{ "Type": 0, "ID": 0, "ItemData": {}, "EditorialUrl": “http://server:port/path/page.htmel” }
{ "Type": 0, "ID": 0, "ItemData": { "Url": "", "Width": 0, "Type": 0, "ID": 0, "Height": 0 }, "EditorialUrl": “http://server:port/path/page.html” }