cancel
Showing results for 
Search instead for 
Did you mean: 

How to consume Personalized Recommendation endpoint in deployed ui5 app

matthias_kainz
Explorer
0 Kudos

Hello experts,

I am trying to consume the next-items endpoint of the Personalized Recommendation Service within my HTML5 Application, which is deployed in SAP BTP Cloud Foundry.

Locally I used a proxy to consume the endpoint and that's working well.

But it is not working in the deployed version:

First I created a destination in the BTP:

Full Token Service Url: https://<...>.authentication.eu10.hana.ondemand.com/oauth/token

In my xs-app.json of the ui5 app I configured the destination:

And in my controller I made an AJAX POST request to following URL: "/standard/rs/vs/tenants/{myTenant}/recommendations/next-items?site={mySite}"

In my HTML5 Application and when I open the app in the Launchpad Service I get an 403 Forbidden Response

Can anyone help me with this problem?

Thank you.

Matthias

matthias_kainz
Explorer
0 Kudos

Update:

I forgot the csrf-Token in my request.

But now I get a 404 Not found with the absolute URL.

I also tried to use the relative URL:

One of my OData requests is sent to:

I rebuild that logic and sent a request to:

https://XYZ.launchpad.cfapps.eu10.hana.ondemand.com/01c4ebd9-86bb-4994-95e6-780279aace46.ABC/~081222...;

Here i get a 500 External Server Error.

Accepted Solutions (0)

Answers (1)

Answers (1)

sebastienb
Product and Topic Expert
Product and Topic Expert

Hi Matthias,

Thanks for using Personalized Recommendation!

From what we see in your message, it seems you are able to call our API locally, which means that our service is responding as expected. It looks like a UI5 or Launchpad issue. I'll let my colleagues from those services answer. Feel free to get back to me whenever you need further help.

Best,

Sébastien

matthias_kainz
Explorer
0 Kudos

Thank you for your quick response!

Hopefully one of your colleagues can help me.