We developed an app using Atlassian forge. we have one requirement to call an external service API in forge. We are using the Fetch API from ‘@forge/api’ package to make those API calls. But , Fetch always returns the response like {“headers”:{},“ok”:true,“status”:200,“statusText”:“OK”} instead of what we set up at service API level.
Tried both the await and promise approach but nothing changed.
Hi @IyyappanR welcome to the community. That certainly does seem like odd behavior - I would expect an error message if there was a configuration issue for instance. I’m on the team that implemented this feature and will try and help you figure this one out.
Could you provide code snippets from your app manifest file and a snippet of how you’re calling the fetch API in your code to help us reproduce it? Also, just for my understanding, what is the expected response from your service API? (status code, with or without a body, etc.)
Thanks for your response @ChrisWilliams . we are expect the response with body and status code details. but we are received the response in below format .
{“headers”:{},“ok”:true,“status”:200,“statusText”:“OK”}
As Forge applications are run on Atlassian’s infrastructure, you won’t be able to access resources hosted on your local machine such as on localhost. I’m not sure why you’re getting a 200 response here but you’re best off making requests to a publicly hosted URL on the internet either directly or via Forge External Authentication if you need authenticated requests.
We tested the fetch request from public hosted URL( deployed service in Azure app Serivice) as well. we are getting the response always {“headers”:{},“ok”:true,“status”:200,“statusText”:“OK”} instead of body of the response.