Rest API - Issue does not exist or you do not have permission to see it.

John Crumley August 28, 2019

Hello,

I am trying to get a curl command to work with basic authentication to retrieve the description of an issue.   When I run the curl command, I get an HTTP 404 response with this data:

{"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}[

 

The command I am trying is...

curl -D- -u myemailaddress:APIToken -X GET -H "Content-Type: application/json" https://ourdomain.atlassian.net/rest/api/3/issue/PROJ-1234

If I log in through a web browser as myemailaddress and then paste the exact URL (https://ourdomain.atlassian.net/rest/api/3/issue/PROJ-1234) into the browser, I get the expected result.

I get the same result for "/rest/api/2" and "/rest/api/3" (works in browser not from CURL.

The API token was created by while logged in as myemailaddress as outlined here:  https://confluence.atlassian.com/cloud/api-tokens-938839638.html

I have not found anywhere the API needs to be "enabled" in general or for a specific token.  I have not found anywhere that the token has to be permissioned independently from the user to whom the token belongs.

Note this is not an authentication issue with the username/password (-u) of the curl command.  If those are wrong, the response I see for that is HTTP 401 - Authentication Failed.

Thanks in advance for any suggestions (or answers!),

John

 

2 answers

1 accepted

3 votes
Answer accepted
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2019

@John Crumleyit is working fine on my instance.

Have you checked that your API TOKEN is active and not revoked. Because I get 404 with exact same error response when I used revoked API token.

Also you can try it with new API token.

John Crumley August 29, 2019

Hi DPK!

Thank you for the suggestions.  I have confirmed the existing token is good by checking https://id.atlassian.com/manage/api-tokens.  It has "revoke" as an option next to it and shows "last accessed" of a couple minutes ago (I tried again this morning).

I also created a new token and tried it with the same result. 

My experiments seem to indicate that the username in the curl statement is ignored.  As long as there is a username (does not need to be valid) and the token is valid I get the 404 response.  If I make the token invalid, I get the 401 response.

This makes me wonder if I am using the correct username.  I eventually looked at the email which was sent notifying me of your comment and realized it was an old email address (first name only vs first name last name).

Once I put the correct username in, everything worked fine.

Thanks for the help,

John

Like # people like this
snutiise November 15, 2020

Thank you so much

Eirikur Emilsson December 23, 2020

It was my username without the @Test Company.xxx 

Like goundla5 likes this
Omprakash Mankar July 3, 2021

hi, I am also facing the same issue I don't why I have applied to give an above-all solution but working could you please let me know.
you guys have a solution.

Screenshot 2021-07-02 at 7.05.20 PM.png

Like Revathi Rajmohan likes this
0 votes
Balamurugan Petchimuthu
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!
November 28, 2023

I got the same error but I am using the "Service class with ArrayConfiguration" method, Like the above case If search the URL I can access it, but with my application I can only the error

Suggest an answer

Log in or Sign up to answer