Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

rest call returns 200 butreturn is empty

ALAIN THIRE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 24, 2024

I try to get the list of projects with the rest api. I use a test account and use the following call

https://<prj>.atlassian.net/rest/api/3/project/

  • If I open this url inchrome I get the list of the projects
  • However if do this in postman I get an empty reply
  • I also get an empty reply in Edge
  • If I call search with a projectId , it sais that it doesn't exist

What am I doing wrong ?

Help appreciated

 

 

2 answers

0 votes
Dorene Watson May 15, 2024

@Aaron Pavez _ServiceRocket_ Following this issue. I am having the same issue in our Jira instance. We are hosted in AWS(not Atlassian cloud).   When making the GET /rest/api/2/project call from within an integration partner's software and using a bearer token that has full Admin rights, we get 200, but no data back. We've added IPs and connection is working. And I can make the call from postman with the same token and it returns data.

Why would Jira return a 200 but no data?

Dorene Watson August 21, 2024

Figured out that the Jira API sometimes returns no data when the token being used in the request passes authentication and authorization but there is no data to return. This is 'bad practice' for an API, it should return a 204(successful but no content) or an empty data set at minimum.

0 votes
Aaron Pavez _ServiceRocket_
Community Champion
April 24, 2024

Hi @ALAIN THIRE 

Are you logged in to Atlassian when using edge?

Do you have the API token and email in postman?

Regards

Aaron

ALAIN THIRE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 25, 2024

Hi, desn't matter wether Iam logged in or not in edge

  https://atvantage.atlassian.net/rest/api/3/project/  returns in  the expected list of projects 

However if I do  the call in postman  it doesn't work 

Schermafbeelding 2024-04-25 091304.png

Mahtab
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2024

Hi Alain,

When using postman, instead of password, we need to use our API token for this to work .

Postman application with basic authentication: username + api token

Hope this helps.

Like Flynn Rosenbohm likes this
Flynn Rosenbohm August 21, 2024

I was having the same issues, this worked! In the Headers there needs to be an entry with the key as "Authorization" with the value "Basic <Username: api-token>", but the username + token has to be encrypted in base64. The Token also needs to be inside the password field inside of the Authorization Tab. Don't know why the Documentation is so awfully written.

Like Dorene Watson likes this
Ramashry Ramashry January 1, 2025

@Flynn Rosenbohm 

What do you mean by "but the username + token has to be encrypted in base64" Can you share a screenshot of this, I am using Postman but facing same issue where the authentication is complete and showing as "200 ok" but when i am trying to fetch the project. It is giving me no data in Value section

 

Ramashry Ramashry January 1, 2025

No Problem the issue is automatically fixed when i tried to GET "https://myenvironment.atlassian.net/rest/api/3/myself" which automatically fetch somewhat 18 Headers in postman and after that when I fetch this "https://myenvironment.atlassian.net/rest/api/3/project/search?maxResults=50" It was giving me values.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events