<<

TABLE OF CONTENTS

1 INTRODUCTION 3

1.1 WHAT IS THE CONTENT DISCOVERY API? 3 1.2 PRODUCTS USING THE METADATA & CONTENT DISCOVERY API (FOR YOUR INSPIRATION) 4

2 WHAT YOU NEED TO KNOW 5

2.1 CONTENT DISCOVERY API 5 2.2 UNDERSTANDING CHANNELS AND PROGRAMS 5 2.3 HOW TO BEGIN 7

3 RETRIEVING CURATED THEME CHANNELS WITH 8

3.1 THEME CHANNEL LIST 8 3.2 THEME CHANNEL LIST 9 3.3 THEME CHANNEL GROUPS 11

4 RETRIEVING NEWS VIDEOS FROM FUNKE’S EDITORIAL OFFICES 12

4.1 GET A LIST OF ALL AVAILABLE FUNKE SOURCES 12 4.2 GET A LIST OF THE LATEST 50 NEWS VIDEOS FROM TWO SPECIFIC SOURCES (HERE: BERLINER MORGENPOST AND HAMBURGER ABENDBLATT) AND SORT BY PUBLICATION DATE 13 4.3 GET RELATED NEWS VIDEOS THAT MATCH THE TOPIC OF YOUR SELECTED NEWS VIDEO 14

5 MORE API FEATURES 15

5.1 SEARCH BY CONTENT 15 5.2 FILTERING AND SORTING CONTENT 15

6 EPG TOOLS: WHAT’S ON TV AND ON NETFLIX? 18

6.1 INTRODUCTION 18 6.2 EPG CALLS 19

7 RECOMMENDATION ENGINE 23

7.1 SIMILARITY RECOMMENDATIONS 23 7.2 EPG PERSONAL RECOMMENDATION CALLS 25

8 APPENDIX 31

9.1 USEFUL REFERENCES 31 ➔ HTTPS BASICS 31 ➔ UNIREST 31 ➔ CONTENT DISCOVERY API 31

API How-to 2

1 INTRODUCTION

1.1 WHAT IS THE CONTENT DISCOVERY API? The Content Discovery API (CDAPI) is a web service conceived to provide users information about:

• What’s on TV (70 channels, 14 days in the future) • What’s available On Demand (Mediathek, Netflix, Sky Go, etc.), in many cases including links to these services

It contains the editorial information prepared by the editors of FUNKE’s TV guide magazines (FUNKE Programmzeitschriften), including pictures, reviews, editorial recommendations of what to watch and more.

In addition, the Content Discovery API provides access to news and entertainment videos (including direct links to video files) that are available to FUNKE’s editors:

• FUNKE news videos: From sources like Berliner Morgenpost, Hamburger Abendblatt, Der Westen, & more • watchmi theme channels: Curated playlists from external partners such as BILD, kicker, dpa in categories such as news, lifestyle, cars, travel, kids & more (more than 50 sources available).

The Content Discovery API also provides access to a recommendation engine that offers the following key features:

• Similarity Recommendations: Find similar assets to the one you are looking at, for example: o if you watch ‘Big Bang Theory’ you should watch ‘How I Met Your Mother’ o if you watch a news video about Donald Trump at the Hurricane in Texas, here are more news videos about Donald Trump and the Hurricane in Texas.

• Personalization: TV shows and/or videos that match your taste: o Create users o Create multiple profiles per user o Send ratings (thumbs up/down) for assets o Retrieve personalized reocmmendations based on user’s rating history

The recommendation works for both TV listings and for news videos.

API How-to 3

1.2 PRODUCTS USING THE METADATA & CONTENT DISCOVERY API (FOR YOUR INSPIRATION) TV Listings, On Demand & Personalization

• Alexa Skill: Fernsehprogramm (https://www.amazon.de/Funke-Zeitschriften-Service- Fernsehprogramm/dp/B06ZZL8NLY)

• Discover TV DIGITAL tablet app (tablet only) o iOS: https://itunes.apple.com/us/app/discover-tv-digital-dein-pers%C3%B6nliches-tv- programm/id1130333441?mt=8 o Android: https://play.google.com/store/apps/details?id=de.tvdigital.discovery.sky

: www.zattoo.com

News Videos

Watchmi Web APP (http://www.watchmi.tv/de/themechannels) Watchmi Android APP (https://play.google.com/store/apps/details?id=tv.watchmi.app.tc) Watchmi iOS APP (https://itunes.apple.com/de/app/watchmi-video-aktuelle-news/id1011118832?mt=8)

API How-to 4

2 WHAT YOU NEED TO KNOW

2.1 CONTENT DISCOVERY API Our Content Discovery API (CDAPI) works using a set of predefined HTTP requests, which provide developers access to all the media content; equipped with a set of parameters to filter data by different criteria (time, length, genre, actors, etc). As a result of each request, the API returns a response code with the requested data in JSON format.

Figure 2.1 Example of CDAPI HTTP Request (Query URL)

2.2 UNDERSTANDING CHANNELS AND PROGRAMS In the CDAPI, channels are identified as sources and programs/media-content as assets. The sources display the assets. Attached to each source there is a document, which provides useful information about it (channel logo, theme, etc). To make easier locating content, assets are sorted in lists and sources classified by themes in groups.

Each asset/source/group/list is identified by a unique ID, used for interconnecting them and allowing developers to navigate through all the media content.

Figure 2.2 Domain Model, hybrid between the JSON structure provided by the CDAPI and the asset-source logic for theme channels, to illustrate navigability between elements

API How-to 5

Here you can see how entities match with real media content in some of the screens from our apps, all of them developed with the same tool we are providing to you:

Figure 2.3 Screen from the watchmi web app. The channels, program, channel, groups and list are labeled in different colors to show how they correspond with the entities from the Domain Model

Figure 2.4 Screen from the Sony TV watchmi web app. The channels, program, channel groups and list are labeled in different colors to show how they correspond with the entities from the Domain Model

API How-to 6

2.3 HOW TO BEGIN Base URL

In order to provide access to the CDAPI, Funke Digital TV Guide provides customers a personal URL which grants access to all the services of our tool. In our tutorial we will use this URL: http://hack.api.watchmi.tv

• User name: hack2017 • Password: funke

More Documentation http://hack.api.watchmi.tv/docs/

API How-to 7

3 RETRIEVING CURATED THEME CHANNELS WITH VIDEOS

3.1 THEME CHANNEL LIST

Get an array with the set of theme channels:

http://hack.api.watchmi.tv/documentstore/sources ?filter={"term":"assetTypes","value":"theme"}

API How-to 8

Example: get all theme channels provided by the CDAPI

http://hack.api.watchmi.tv [{ /documentstore "sourceType":"1", /sources "keywords":{}, ?filter={ "sourceNames":{ "term":"assetTypes", "long":{ "value":"theme"} "deu":"MusikSelection"}, "short":{ "deu":"MusikSelection"}}, "maxNoOfRecordings":0,...

3.2 THEME CHANNEL LIST

API How-to 9

Get all the information attached to a selected theme channel:

http://hack.api.watchmi.tv/asset?assetType=theme&entitlementSources=[]&annotation=theme-all

Example: get the first content provided by the CDAPI from the channel “Neuwagen.de” t http://hack.api.watchmi.tv [{ /asset "asset":{ ?assetType=theme "assetType":"theme", &entitlementSources=[ "assetId": "3051bf7f-9511-7f74-75ad-a263ecb56595"] "12885fb2-f170-97a4-b178-278dd973ea02", &annotation=theme-all "sourceId": &paginationLimit=1 "3051bf7f-9511-7f74-75ad-a263ecb56595", "availabilityStartTime": "2016-04-05T12:21:59+02:00", "availabilityEndTime": "2016-04-12T01:59:59+02:00",...

It is also possible to get this information using the next request:

http://hack.api.watchmi.tv/list/moderated/

API How-to 10

3.3 THEME CHANNEL GROUPS

Get an array with the list of theme channel groups:

http://hack.api.watchmi.tv/documentstore/sourceGroups? filter={"term":"sourceGroupType","value":"theme"}

Example: get the first channel group provided by the CDAPI

http://hack.api.watchmi.tv [{"sourceGroupNames": /documentstore {"deu":"Nachrichten"}}] /sourceGroups ?filter={ "term":"sourceGroupType", "value":"theme"} &annotationAttributes= ["sourceGroupNames"] &paginationLimit=1

API How-to 11

4 RETRIEVING NEWS VIDEOS FROM FUNKE’S EDITORIAL OFFICES

4.1 GET A LIST OF ALL AVAILABLE FUNKE VIDEO SOURCES

http://hack.api.watchmi.tv/documentstore/sourceGroups/funke

API How-to 12

4.2 GET A LIST OF THE LATEST 50 NEWS VIDEOS FROM TWO SPECIFIC SOURCES (HERE: BERLINER MORGENPOST AND HAMBURGER ABENDBLATT) AND SORT BY PUBLICATION DATE

http://hack.api.watchmi.tv/asset?entitlementSource= ["brightcove-57ac96a9c7f27079d2000cb5", "brightcove-57ac9762be838371457b834c"] &paginationLimit=50&paginationOffset=0&numberOfItems=1000 &filter={"operator":"and", "criteria":[ {"term":"availabilityStartTime","operator":"atMost", "value":"2017-09-01T11:22:45%2B02:00"}, {"term":"availabilityEndTime","operator":"atLeast", "value":"2017-09-02T11:22:45Z"}, {"term":"assetType","operator":"in", "values":["video","footage","broadcast"]}, {"term":"publicationTime","operator":"atLeast", "value":"2017-07-01T11:22:02Z"} ]} &sorting=multi&multiSorting=[ {"criterion":"publicationTime","direction":"descending"}] &annotation=full

API How-to 13

4.3 GET RELATED NEWS VIDEOS THAT MATCH THE TOPIC OF YOUR SELECTED NEWS VIDEO

http://hack.api.watchmi.tv/recommendations?context=news_video_similarity &seedAsset=brightcove-5557491711001 &paginationLimit=12 &paginationOffset=0 &adHocContext={ "rules": [{"then":{ "similarityEngines":[{"name":"SimilarTV","minScore":0.5}], "global": {"filter":{"operator":"and", "criteria":[{"term":"availabilityStartTime", "operator":"atMost", "value":"2017-09-01T11:51:35Z"}, {"term":"availabilityEndTime", "operator":"atLeast", "value":"2017-09-01T11:51:35Z"}, {"term":"assetType", "operator":"in", "values":[ "video","footage","broadcast"]} ]}}}}]}

API How-to 14

5 MORE API FEATURES

5.1 SEARCH BY CONTENT Get an array with the set of elements of the CDAPI library that matches with your search input:

http://hack.api.watchmi.tv/search?query=

Example: get an element from the CDAPI library related to Batman

http://hack.api.watchmi.tv/search {"results":[{ ?query=Batman "asset":{ &numberOfItems=1 "assetId":"122712_34664_34664_17368"}, "explanations":[{ "originator":"Search Engine", "level":0, "message":"Recommended because it matches your search string Batman"}], "score":1.0, "businessScore":1.0}]}

5.2 FILTERING AND SORTING CONTENT

Basic queries can be improved by including filter and sort parameters. The API allows filtering of data using the annotationAttributes and filter parameters.

5.2.1 Annotations

Annotations are defined views on API query results. Specify data item fields to be displayed by using the annotationAttributes parameter:

+ &annotationAttributes=[]

API How-to 15

Example: get an element from the CDAPI library related to Batman; limit output fields to German language source name and title

http://hack.api.watchmi.tv/search {"results":[ ?query=Batman {"asset":{ &annotationAttributes= "titles":{ ["sourceNames.long.deu", "deu":"Batman" "titles.deu"] }, "sourceNames":{ "long":{ "deu":"TNT Film"}}}},...

5.2.2 Filters

Specify the set of conditions that each data item obtained from a query has to match.

A filter requires a “term” (item field) and a “value”. Each data item must have a value for the specified term that matches the filter value in order for it to pass through the filter.

+ &filter={”term”:,”value”:}

Example: most of our example queries use filters

http://hack.api.watchmi.tv [{"sourceGroupNames": /documentstore {"deu":"Nachrichten"}}] /sourceGroups ?filter={ "term":"sourceGroupType", "value":"theme"} &annotationAttributes= ["sourceGroupNames"] &paginationLimit=1

API How-to 16

It is possible to combine multiple matching conditions in the same query by using logical operators:

+ &filter={“operator”:,”criteria”:[{”term”:,”value”:},...]}

Example: By adding a filter to the previous example, we limit the results to theme channels and TV channels (broadcast).

http://hack.api.watchmi.tv [{"sourceGroupType":"theme"},{"sourceGroupT /documentStore ype":"theme"},{"sourceGroupType":"theme"},{ /sourceGroups "sourceGroupType":"theme"},{"sourceGroupTyp ?filter={"operator":"or", e":"theme"},{"sourceGroupType":"theme"},{"s "criteria":[ ourceGroupType":"theme"},{"sourceGroupType" {"term":"sourceGroupType", :"broadcast"},... "value":"theme"}, {"term":"sourceGroupType", "value":"broadcast"}]} &annotationAttributes= ["sourceGroupType"]

It is possible to use a set of values instead of a single value while filtering, via the “in” operator:

+ &filter={”term”:,”operator”:”in”,”values”:[,...]}

Example: repeating the query in the previous example using “in” instead of “or”

http://hack.api.watchmi.tv [{"sourceGroupType":"theme"},{"sourceGroupT /documentStore ype":"theme"},{"sourceGroupType":"theme"},{ /sourceGroups "sourceGroupType":"theme"},{"sourceGroupTyp ?filter={ e":"theme"},{"sourceGroupType":"theme"},{"s "term":"sourceGroupType", ourceGroupType":"theme"},{"sourceGroupType" "operator":"in", :"broadcast"},... "values":["theme","broadcast"]} &annotationAttributes= ["sourceGroupType"]

API How-to 17

5.2.3 Sorting

Specify the order in which the CDAPI has to return the set of results from a query. CDAPI provides a multi-sorting utility that allows to sort by more than one field. Sorting just requires the set of fields to sort and the order (ascendent or descendent). The order you place the fields indicates the sorting priority (more to less):

+ &sorting=multi&multiSorting=[{“criterion”:,”direction”:<”ascending” or “descending”>},...]

Example: get an element from the CDAPI library containing the word Batman

http://hack.api.watchmi.tv/search {"results": ?query=Batman [{"asset": &annotationAttributes= {"titles": ["sourcenames.long.deu", {"deu":"Batman"}, "titles.deu"] "sourceNames":{ &sorting=multi "long":{ &multiSorting=[ "deu":"TNT Film"}}},... {"criterion":"titles.deu", "direction":"ascending"}, {"criterion":"sourceNames.long.deu", "direction":"ascending"}]

6 EPG TOOLS: WHAT’S ON TV AND ON NETFLIX?

6.1 INTRODUCTION To this point, we have provided a basic and complete introduction to the CDAPI. We have described the different entities involved in our logic, and how to request data of them from the server. As we mentioned before, it is possible to access to particular data that matches specific criteria using filtering and sorting methods.

Now that we have a minimum level of knowledge related to the CDAPI, we are capable of proceeding with more complex requests. At this point we will continue by listing the set of EPG API calls. These calls are

API How-to 18

specially designed to deal with time and user preferences issues when looking for media content, retrieving asset data based on time frames and user recommendations.

6.2 EPG CALLS

6.2.1 TV Channels List

Returns the list of broadcast channels available in the CDAPI database. Do not confuse with the channel lists previously mentioned in the document, which refers to theme channels.

http://hack.api.watchmi.tv/documentstore/sources? filter={"term":"assetTypes","value":"broadcast"}

Example: get list of broadcast channels (ARD, ZDF, RTL, etc.)

http://hack.api.watchmi.tv/documentstore/sources? filter={"term":"assetTypes","value":"broadcast"} &annotation=["sourceId","sourceNames.short","sourcePosition"]

Example: get list of providers that we have data for (e.g. Netflix, Sky Go)

http://hack.api.watchmi.tv/documentstore/sources? filter={"term":"assetTypes","value":"vodcasts"} &annotation=["sourceId","sourceNames.short","sourcePosition"]

API How-to 19

6.2.2 Current / Next TV Programs

Returns the current and next TV programs scheduled in one or more channels by specifying the set of sources ID to look for.

http://hack.api.watchmi.tv/asset ?beforeAfter={"limit":2,"origin":"currentTime","offset":0} &entitlementSources=[]} &annotationAttributes=["sourceId","assetId","titles"]

Example: get current/next program of the channels whose ID are "100","10045","10047".

http://hack.api.watchmi.tv/asset ?beforeAfter={"limit":2,"origin":"currentTime","offset":0} &filter={ "term":"sourceId", "operator":"in", "values":["100", "10045", "10047"]} &annotationAttributes=["sourceId","assetId","titles"]

6.2.3 TV Schedule Request – Content by time

Returns the set of assets that will be played on TV during a previously defined time frame. Remember to use filters and annotation attributes in order to ask for the content of the desired channels.

http://hack.api.watchmi.tv/asset? filter={"term":"assetType","value":"broadcast"} &windowOfAvailabilityStart= &windowOfAvailabilityEnd=

API How-to 20

Example: different EPG requests based on prime time (20:15 – 22:15) on channels 782 and 783

Note: "+" in timezone offsets must be encoded as %2B so as not to be interpreted as a space

http://hack.api.watchmi.tv/asset? entitlementSources=["783","782"] &windowOfAvailabilityStart=2017-09-06T20:15:00%2B02:00 &windowOfAvailabilityEnd2017-09-06T22:15:00%2B02:00 &numberOfItems=25 &annotation=full

http://hack.api.watchmi.tv/asset? entitlementSources=["783","782"] &windowOfAvailabilityStart=2017-09-06T20:15:00 &windowOfAvailabilityEnd=2017-09-07T20:15:00 &numberOfItems=25 &annotationAttributes=["assetId","titles.deu","sourceId", "availabilityStartTime","availabilityEndTime","durationSeconds"]

6.2.4 Daily TV Schedule

Returns the set of assets that will be played on TV during a day. Remember to use filters and annotation attributes in order to ask for the content of the desired channels and specific attributes.

http://hack.api.watchmi.tv/asset? annotation=full &entitlementSources=[]

Example: daily TV content of channel ID "100"

http://hack.api.watchmi.tv/asset? annotation=full&entitlementSources=["100"]

API How-to 21

6.2.5 TV Program / Asset Data

Returns the meta-data related to a TV program (asset) by specifying its ID. You can use annotations in order to filter the set of data you want to get from the request.

http://hack.api.watchmi.tv/asset? filter={"term":"assetId","value":}

Example: asset and channel ID, program title and availability window of asset "119912792"

http://hack.api.watchmi.tv/asset? filter={"term":"assetId", "value":"119912792"} &annotationAttributes= ["assetId","sourceId","titles","availabilityStartTime","availabilityEndTime"]

API How-to 22

7 RECOMMENDATION ENGINE

Note that the recommendation engine works for both news videos and TV and On Demand content. You can even try to mix (e.g. give me news videos that are related to a TV show or vice versa).

7.1 SIMILARITY RECOMMENDATIONS The simplest forms of recommendations are similarity recommendations.

7.1.1 Similar TV Shows in the next two days

(Be sure to set availabilityStartTime and availabilityEndTime parameters appropriately)

http://hack.api.watchmi.tv/recommendations? seedAsset= &paginationLimit=12 &paginationOffset=0 &adHocContext= {"rules":[{"then": {"similarityEngines": [{"name":"SimilarTV","minScore":0.5, "contribution":1, "seed":"seedAsset"}], "global": {"numberOfItems":100, "filter":{"operator":"and", "criteria": [{"term":"availabilityStartTime", "operator":"atMost", "value":"2017-09-08T11:51:35Z"}, {"term":"availabilityEndTime", "operator":"atLeast", "value":"2017-09-06T11:51:35Z"}, {"term":"assetType", "operator":"in", "values":["broadcast"]} ]}}}}]}

API How-to 23

7.1.2 Similar TV Shows on demand right

(again, be sure to set availabilityStartTime and availabilityEndTime appropriately)

http://hack.api.watchmi.tv/recommendations? seedAsset= &paginationLimit=12 &paginationOffset=0 &adHocContext= {"rules":[ {"then":{"similarityEngines": [{"name":"SimilarVOD","minScore":0.5, "contribution":1,"seed":"seedAsset"}], "global": {"numberOfItems":100, "filter": {"operator":"and", "criteria":[ {"term":"availabilityStartTime", "operator":"atMost", "value":"2017-09-01T11:51:35Z"}, {"term":"availabilityEndTime", "operator":"atLeast", "value":"2017-09-01T11:51:35Z"}, {"term":"assetType", "operator":"in", "values":["vodcast"]}] }}}}]}

API How-to 24

7.2 EPG PERSONAL RECOMMENDATION CALLS

User recommendations are designed to provide customers media content based on preferences related to the ratings they give to the assets. Thanks to this feature, developers can design apps which include features to gather content feedback and ratings from customers, and improve the way content is delivered to them (matching content and target customers in a more accurate way).

To manage personal recommendations the CDAPI uses subscribers. Subscribers represent profiles attached to users, which manages all the functionality related to preferences: voting system, suggested content, etc.

Below we will describe the set of steps to follow in order to manage personal recommendations in the CDAPI:

SUBSCRIBER TEMPLATE ID

To manage preferences we need to create a subscriber, and to create a subscriber a subscriber template it is required. Execute the next call in order to get a subscriber template.

http://hack.api.watchmi.tv/subscriber

The response looks something like:

{ subscriberId: "dd677004-e5df-4f30-9ba8-f4222f64b98f", profiles: [ "dd677004-e5df-4f30-9ba8-f4222f64b98f_sports", "dd677004-e5df-4f30-9ba8-f4222f64b98f_entertainment", "dd677004-e5df-4f30-9ba8-f4222f64b98f_series", "dd677004-e5df-4f30-9ba8-f4222f64b98f_movie", "dd677004-e5df-4f30-9ba8-f4222f64b98f_kids", "dd677004-e5df-4f30-9ba8-f4222f64b98f_VARIOUS", "dd677004-e5df-4f30-9ba8-f4222f64b98f_info" ] }

The important value in here is the subscriberId. It is required in order to clone the template and create our own subscriber.

API How-to 25

CREATE A SUBSCRIBER BASED ON THE SUBSCRIBER TEMPLATE

In order to create a new subscriber, a template-subscriber and new-subscriber IDs are required. The new subscriber ID can be obtained by using any UUID-generating tool, or even specifying a unique and random ID (but the first option is strongly preferred).

To create the new subscriber you should proceed with the next POST request:

POST to http://hack.api.watchmi.tv/subscriber/newSubscriberID → with body: { “template”:“” }

Example: set of CDAPI calls for creating a new subscriber, in JavaScript

var xmlhttp = new XMLHttpRequest(); xmlhttp.open( "POST", "https://hack.api.lab.watchmi.tv/subscriber/exampleSubID",false ); xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); xmlhttp.send(JSON.stringify({ "template": "b1216da9-b2c2-4ab5-9cb6-ebaef88d6d2c", }));

The response looks like this:

{ "subscriberId": "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e", "profiles": [ "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_sports", "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_entertainment", "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_series", "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_movie", "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_kids", "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_VARIOUS", "ef6ac01b-e2cf-4fa4-7ba8-f42c2f64a47e_dd677004-e5df-4f30-9ba8- f4222f64b98f_info" ]

API How-to 26

}

The JSON response block provides us the ID of the new subscriber, alongside a set of different profiles sorted by different genres, in which the CDAPI classifies the ratings for the different assets to generate the recommendations.

RESET A SUBSCRIBER

In some situations it is likely you want to provide users with a way to reset their profiles (remove all information of ratings related to a subscriber). It is possible to reset a subscriber by creating a new subscriber using the ID of the subscriber we want to reset.

This process is the same of creating a new subscriber, proceeding with the same steps described before:

http://hack.api.watchmi.tv/subscriber

POST to http://hack.api.watchmi.tv/subscriber/subscriberToResetID → with body: { “template”:“” }

API How-to 27

DELETE A SUBSCRIBER

Just as with a subscriber profile reset, it is also possible to remove all the ratings related to a user, and remove his subscriber from the system, by deleting its subscriber:

DELETE to http://hack.api.watchmi.tv/subscriber/

Once we know how to create a subscriber, we can use it to rate programs and get recommended media content from the API. In the next lines we will list the set of available features of the CDAPI with recommended content:

RATE A PROGRAM

Assets/programs can be rated with a score and a subscriber ID. This rate can vary from -1 to 1, being -1 the lowest score (negative score) and 1 the highest score.

POST to http://hack.api.watchmi.tv/profile//scorer ?errorTolerant=true &recordingSuggestion=false

→ with body: { "assetId":"", "rating":1, "subscriber":"" }

As you can see, the request works with a subscriber ID and a profile ID. Remember that profile IDs are provided when creating subscribers. There are multiple profile IDs per subscriber. Each one represents a media category for the asset to be rated.

To simplify the way ratings are done, there is an optional request syntax:

POST to http://hack.api.watchmi.tv/subscriber// profile-matching ?errorTolerant=true &allowMultipleMatching=true

→ with body: { "assetId":"", "rating":, "toScore":[], "type":"" }

API How-to 28

GET PERSONAL RECOMMENDATIONS

Returns a set of assets that matches with user preferences by specifying subscriber ID and profile ID. The profile ID indicates the kind of assets on which suggestions should be based. It is possible to filter results by parameters such as starting and ending time.

http://hack.api.watchmi.tv/recommendations? context=pdp_preference_conext &subscriber=<”subscriberId”> &prefProfile=<”profileId”> &availabilityStartTime=<”windowStartTime”> &availabilityEndTime=<”windowEndTime”> &adHocContext={"rules":[ {"then":{"preferenceEngines":[{"name":"PrefTV"}], "global":{"numberOfItems":<”number of results to get”>, "annotation":"dailypicks"}}} ]}

Example: asking for personal series recommendations using a specific subscriber and temporal window

http://hack.api.watchmi.tv/recommendations? context=pdp_preference_context &subscriber=294d2490-65f2-11e4-9803-0800200c9a66 &prefProfile=294d2490-65f2-11e4-9803-0800200c9a66_dd677004-e5df-4f30-9ba8- f4222f64b98f_series &availabilityStartTime=2014-11-07T19:15:00Z &availabilityEndTime=2014-11-07T21:15:00Z &adHocContext={"rules":[ {"then":{"preferenceEngines":[{"name":"PrefTV"}], "global":{"numberOfItems":10, "annotation":"dailypicks"}}} ]}

API How-to 29

CONTACT

FOR ANY QUESTION, SUGGESTION, PROBLEM YOU HAVE YOU CAN CONTACT US:

Thomas Zier Gordon Kramer Head of Product Management Technical Director LinkedIn Gordon.kramer@funke- Skype: t_zier zeitschriften.de Mobile: +49 151 64173017 Thomas.Zier@funke- zeitschriften.de

API How-to 30

8 APPENDIX

9.1 USEFUL REFERENCES

➔ HTTPS BASICS

All you need to know about HTTP Request and how to execute it in the most popular programming languages:

Basic knowledge about HTTP requests

JavaScript

Java

PHP

Python

Ruby

➔ UNIREST

Open-Source project for a lightweight HTTP requests platform in different programming languages. The tool is documented with useful information and examples:

unirest.io project website

➔ CONTENT DISCOVERY API

Official web page of our development tools:

Content Discovery API Official Web page

API How-to 31