401 Unauthroized error when running curl GET API command on my localhost

craig lemay October 16, 2017

Hello all, I'm trying to run a simple GET request through the JIRA API. However, every time I run the code, I am getting a 401 Unauthorized error, despite using my admin username password.

What am I missing in my snippet in order to give authorization?

Here is the snipped of what I'm using:

curl -D- -u user:userPassword -X GET -H "Content-Type: application/json" "http://localhost:8080/rest/api/2/user?username=selectedUser

1 answer

1 accepted

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
October 16, 2017

Everything looks good. There is an extra double quotes before your url but I am guessing that is a typo.

Make sure your username and password is correct. Can't think of any other issues.

craig lemay October 23, 2017

That fixed it, thanks!

Suggest an answer

Log in or Sign up to answer