1 Reply Latest reply on Jul 5, 2017 7:00 AM by Runal.Trivedi

    Accessing Recommendation Data through Target APIs

    Runal.Trivedi Level 4

      Hi,

       

      We have a requirement where we have to access the recommendation data through API, and show the each Recommended Item at specific location in result set on the landing page. Consider as in search results, you are injecting recommended items at specific locations.

       

      For this I have a recommendation activity running on a page that return me the result set, when I use the standard replace content option in activity settings.

      I tried to access the same activity on that page using the standard Target APIs. For e.g.:

       

      I referred documentation as mentioned by Adobe on following page - Delivery

       

      Steps I followed: I Used POSTMAN (Chrome addon) to test this.

      POST URL - http://clientid.tt.omtrdc.net/rest/v1/mbox/12223434537?client=clientid

       

      Request JSON:

      {

        "mbox" : "target-global-mbox", 

        "requestLocation" : {

          "pageURL" : "http://www.abc.com/test/parentpage/child-page/some-targeted-page", 

          "host" : "www.abc.com",

          "impressionId" : "1"

        },

        "mboxParameters" : {

          "screenHeight" : "900",

          "screenWidth" : "1440",

          "browserWidth" : "1440",

          "browserHeight" : "278",

           some other parameters...

        }

       

      }

       

      But when I try to hit above request in POSTMAN, I always get below response:

       

      Response:

      {

          "status": 501,

          "message": "Unable to serve visual offers through server-side calls"

      }

       

      To debug further, I tried to change the call to non-recommendation activity type, like a standard A/B testing. But that too gives me the same response.

       

      I have following questions related to above requirement:

      1. Is it possible to programmatically access the Recommendation result set? If yes, then if someone can please provide any pointers?

      2. What is wrong with above request/response. I am following the github example as listed here - Lesson 1: The Tools of the Trade · Adobe-Marketing-Cloud/target-api-examples Wiki · GitHub

      •      Only change I have made to my request is; I am not generated thirdpartyID, as I don't have a need to track this as a user behavior, and I just need to provide recommendations, in a scattered way on some landing page.

       

      Please let me know if anyone has tried such thing, and what is the ideal way to achieve it.

       

      Thanks in Advance!

      Runal