on 2023 Apr 24 8:36 PM
Hello,
I am trying to call API trigger direcly from SAPUI5 application. I am getting the token correctly. I am sure my json is correct. When I try to make same call from postman its working. Could anyone tell me what I am doing wrong?
Here is the ajax call I make:
var vToken = "Bearer " + oToken; $.ajax({ url: "https://spa-api-gateway-bpi-eu-prod.cfapps.eu10.hana.ondemand.com/workflow/rest/v1/workflow-instances", contentType: "application/json", type: "POST", data: JSON.stringify(oJson), success: function (oData, oResponse) { debugger; }.bind(this), error: function (oError,oErrorMessage) { debugger; }, beforeSend: function (xhr) { xhr.setRequestHeader("Authorization", vToken); }Here is the response( doesn't say much 😞
Also throws this error on console:
Request clarification before answering.
Hi Mehmet,
I think the CORS issue is coming up because you are hardcoding the whole URL in the application.
You need to create a destination for this service endpoint in the SAP BTP account, then call this destination from your SAPUI5 application.
This will resolve your issue.
In case you are totally new to this concept, I would suggest you read out destination connectivity concept for SAPUI5 and SAP BTP. It will provide you a great insight on the connectivity mechanism to external API's for SAPUI5 apps.
Thanks
Shobhit Pathak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.