Hi Experts,
We have a requirement to consume a REST API in an SAPUI5 application developed in SAP Business Application Studio (BAS). I am able to consume ODATA service but for a REST API getting HTTP 404 error code, can you all please look at below scenario and help if I am missing out something. This is now on high priority any sort of help would be much appreciated.
Please note below:
I have create a FIORI app in SAP BAS having Target Runtime as Cloud Foundry and Using MANAGED APPROUTER, app id in manifest is ns.zzidexx2
Create a destination name "jsonplaceholder" in subaccount
Modified xs-app.json to include a route for redirection of API calls to destination
calling the REST API in view controller along with destination name
Tested the destination "jsonplaceholder" from BAS, it is working fine






-Regards,
Rauf Shaikh
Request clarification before answering.
Couple of things;
When running on Business Application studio, ensure the path in the ui5.yaml | ui5-local.yaml is defined as follows;
backend:
- path: /jsonplaceholder
url: "https://jsonplaceholder.typicode.com/"
destination: jsonplaceholderIf running on mac or windows, then the URL is read and not the destination since this flow is only supported on BAS.
Also, update your destination configuration properties from odata_abap to odata_json. This is not an ABAP backend which normally exposes catalogs of services.
Please update your curl command to the following, appending the https protocol
curl -v https://jsonplaceholder.dest/jsonplaceholder/posts
If all this works, then the xs-app.json you already have defined should handle the routing when deployed to CF.
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello John ,
I had similar kind of issues. Can you please give me some points where i did wrong .

manifest.json
"Cleartext": { "dataSource": "Cleartext" }xsapp.json { "source": "^/Cleartext/(.*)$", "target": "/$1", "destination": "Cleartext", "authenticationType": "none", "csrfProtection": false },UI5.yml backend: - path: /sap url: https://xyz.com destination: S4HDEV_DEST_S4CLOUD - path: /Cleartext url: "https://api-sandbox.clear.in/einv" destination: CleartextStill it is giving me 404 error .Can you provide some input.BRDDHi,
Your destination is configured as a full URL destination i.e. the URL defined should have the full path to the OData XML service. However, if you open a browser tab and hit https://api-sandbox.clear.in/einv this returns 404. So the 404 issue is unrelated to destination configuration, you need to debug why your endpoint is returning this HTTP status.
In your xs-app.json and your ui5.yaml your settings look correct. The issue is with the URL endpoint not exposing a service but instead returning 404.
Refer to Guided Answers for more debugging around full url destinations
https://ga.support.sap.com/dtp/viewer/index.html#/tree/3046/actions/45995:48363:53594:48366:51208
John
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.