{"id":776,"date":"2017-08-16T14:53:30","date_gmt":"2017-08-16T14:53:30","guid":{"rendered":"http:\/\/live.ecd-demo.com\/apihelp\/?page_id=776"},"modified":"2017-08-16T14:53:30","modified_gmt":"2017-08-16T14:53:30","slug":"getting-started","status":"publish","type":"page","link":"https:\/\/apihelp.ecd-demo.com\/index.php\/documentation\/recommendations\/getting-started\/","title":{"rendered":"Getting Started"},"content":{"rendered":"<p>Recommendations for a subsciber based on the pre-defined context<\/p>\n<pre><code class=\"swift\">GET http:\/\/&lt;api&gt;\/recommendations?context=&lt;contextid&gt;&amp;subscriber=&lt;subscriberid&gt;\n<\/code><\/pre>\n<h4>Response:<\/h4>\n<pre><code class=\"json\">{\n  \"recommendations\": [\n    {\n      \"explanations\": [\n        {\n          \"originator\": \"Preference Engine\",\n          \"type\": \"engine\",\n          \"level\": 0,\n          \"message\": \"Recommended because it matches your preferences\"\n        },\n        {\n          \"originator\": \"Preference Engine\",\n          \"type\": \"reference\",\n          \"level\": 2,\n          \"message\": \"Profile: Movies\"\n        },\n        {\n          \"originator\": \"Preference Engine\",\n          \"type\": \"feature\",\n          \"level\": 3,\n          \"message\": \"You like genre Thriller &amp; Suspense, genre Suspense\"\n        }\n      ],\n      \"score\": 0.956311821937561,\n      \"businessScore\": 0.956311821937561,\n      \"groupId\": \"0\",\n      \"asset\": {\n        \"assetId\": \"209-20170809024800\",\n        \"assetType\": \"linear\",\n        \"uiProgramType\": {\n          \"en\": \"Movie\"\n        }\n      }\n    }\n  ]\n}\n<\/code><\/pre>\n<h3>What is Context?<\/h3>\n<p>All configuration parameters and weight functions used to provide recommendations are called a Context. Every<br \/>\nrecommendation request is based on a Context. Contexts can be predefined and referenced in the<br \/>\nrecommendation request by a context ID, or can be provided as body of the recommendation request, called an<br \/>\nAd-hoc Context. A combination of predefined and ad-hoc Contexts is supported, too.<\/p>\n<pre><code class=\"json\">{\n    \"contextId\": &lt;contextId&gt;,\n    \"rules\": [\n        \"then\" : {\n        .....\n        }\n    ]\n}\n<\/code><\/pre>\n<h4>Example<\/h4>\n<pre><code class=\"json\">{\n        \"contextId\": \"preference\",\n        \"rules\": [\n            {\n                \"then\": {\n                    \"blendingPreferenceEngines\": [\n                        {\n                            \"name\": \"blendingPrefEngine1\",\n                            \"minScore\": 0.5,\n                            \"contribution\": 1,\n                            \"profileWeights\": \"logENumberOfPositiveRatings\"\n                        }\n                    ],\n                    \"global\": {\n                        \"grouping\": \"series\",\n                        \"numberOfItems\": 1000,\n                        \"typeOfItems\": \"groups\",\n                        \"language\": \"en\",\n                        \"annotation\": \"customAnnoation1\",\n                        \"maxGroupSize\": 1,\n                        \"maxExplanationLevel\": 3\n                    }\n                }\n            }\n        ]\n    }\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recommendations for a subsciber based on the pre-defined context GET http:\/\/&lt;api&gt;\/recommendations?context=&lt;contextid&gt;&amp;subscriber=&lt;subscriberid&gt; Response: { &#8220;recommendations&#8221;: [ { &#8220;explanations&#8221;: [ { &#8220;originator&#8221;: &#8220;Preference Engine&#8221;, &#8220;type&#8221;: &#8220;engine&#8221;, &#8220;level&#8221;: 0, &#8220;message&#8221;: &#8220;Recommended because it matches your preferences&#8221; }, { &#8220;originator&#8221;: &#8220;Preference Engine&#8221;, &#8220;type&#8221;: &#8220;reference&#8221;, &#8220;level&#8221;: 2, &#8220;message&#8221;: &#8220;Profile: Movies&#8221; }, { &#8220;originator&#8221;: &#8220;Preference Engine&#8221;, &#8220;type&#8221;: &#8220;feature&#8221;, &#8220;level&#8221;: 3, &#8220;message&#8221;: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":766,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-776","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":0,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/776\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/766"}],"wp:attachment":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/media?parent=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}