Jira Cloud api GET /rest/api/latest/project returns empty array (using api token authorization)

Henrik Martinussen March 25, 2022

Hi :-)

I'm struggling with connecting to jira cloud api's.

I'm using api token authorization in a Authorization header in PostMan

The service returns http 200 but the payload is an empty array, which surprises me since I can paste the url into a browser and get a nice json containing all our jira projects and their attributes.

I concatenate my email address, a colon and the api token and base 64 encode the result. This i use in an Authorization header; 'Basic Y<58>='

 

Any suggestions are welcome :-)

1 answer

1 vote
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2022

Hi @Henrik Martinussen I just tested it and it works fine.

You need to use "basic auth" in postman and use Access token as a password.

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

Henrik Martinussen March 28, 2022

Hi Martin thank you for your prompt response.
Unfortunately I'm still at a loss as to get non empty results from jira cloud api.
The simplest case (which I still can't manage to get non-empty results from) is; 

[http GET] https://<company>.atlassian.net/rest/api/latest/project [I know its deprecated - I have tried https://<company>.atlassian.net/rest/api/latest/project/search?query=<projectName> as well, with similar results]

As I mentioned, i get a nice 200  - but an empty array. As I said; when I paste the url into a browser I get a json containing all our projects and their attributes.

I already tried what you suggest; I have experimented with various id's (AD name, 7 digit integer user id, user guid with and without @<company>.<tld>) and I have done that using the Authorization tab in PostMan as well as in an Authorization Header [Basic Y<xxx>=] - I have also experimented with base64 encoding <emailaddress>:<api token> in an Authorization header.
None of these attempts has brought me closer to a non-empty array of projects.

Would you please elaborate on your technique/settings - I would really like to get connected to the jira api's

 

Thanks in advance

John Howell November 14, 2022

Hi Henrik, I experience this too. Did you get it resolved?

John Howell November 14, 2022

Henrik, in my case, I had correctly setup the auth variables at the top of my collection, but the specific GET item below was not inheriting the auth and was returning a 200 response but with blank response. Enabling the inheritance of the authentication resolved this.

Like # people like this

Suggest an answer

Log in or Sign up to answer