cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CORS error on API call

kaori_oiwa
Explorer
0 Likes
2,026

Hi,

I am currently attempting to call Jira's API from SAP Build Apps, but I am getting a CORS error when calling the API with an API Token.

The call succeeds when executed from postman in the same manner.
Does anyone know of a solution?

Error:

Error: TypeError: Failed to fetch. Does the server allow CORS?status: undefined

Resource settings for Get collection (GET)

-------------------

Resource URL: https://xxxxxxxxx/rest/api/3/issue/KAN-xx

Relative path: undefined

Target API

Best Regurd,

Accepted Solutions (1)

Accepted Solutions (1)

Yogananda
Product and Topic Expert
Product and Topic Expert
0 Likes

kaori_oiwa

you need to user SAP BTP Destination in that case to avoid CORS or develop nodejs api binding using cors npm module.. you can get a lot of information in google or search in blogs.sap.com for the next step

Answers (1)

Answers (1)

agpekka
Product and Topic Expert
Product and Topic Expert
0 Likes

Yes, the easiest thing is to add Jira api as BTP destination.
Postman works because it is not a browser, but browsers do check the access-control-allow-origin header from the response and unless it is set to accept all (*) or your domain specifically, the response is rejected.