Forums

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

using API token issue

thomas.guest
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!
August 13, 2019

Hi,

I'm trying to use a simple curl request to get details of an issue but it is failing with 

 

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

I'm using the following Curl request

curl -D- \
-H "Authorization: Basic base64encoded(emailaddress:APIToken)" \
-H "Content-Type: application/json" \
"https://<site-url>/rest/api/2/issue/TEST-1"

If I hit the same url in a browser it works fine.

When I look at my API token dashboard I can see that the last accessed field updates to "a few seconds ago" when I make the curl request. If I put in a wrong base64encoded value I get an HTML response.

 

2 answers

0 votes
Wesley Harris August 13, 2019

This command worked for me on a brand new cloud site:

curl -D- --user emailaddress:apitoken https://mysite.atlassian.net/rest/api/2/issue/TEST-1

 

Maybe wrong email, invalid issue, or the Content-Type header is throwing things. Try with the --user switch

0 votes
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2019

Hi @thomas.guest 

I think that you need to pass through a method of GET, although I don't know what the syntax is like because I've never used Curl

thomas.guest
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!
August 13, 2019

Thanks for the reply. It defaults to a GET by default. I've making it explicit but that also doesn't work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events