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
@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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It was my username without the @[deleted].xxx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.