Hello Jira expert,
I need a help for solving the 401 errors with REST API.
I read several articles on Jira community but still I can't figure out its cause.
I follow the steps in
https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-basic-authentication/
and then run curl command below.
curl -D- \
-u my_username@my-domain.atlassian.net:MY_JIRA_API_TOKEN \
-X GET \
-H "Content-Type: application/json" \
https://my-domain.atlassian.net/rest/api/latest/issue/PROJECT-131
and it returns response including Unauthorized (401) .
I confirmed that my_username can see issue in the PROJECT on the browser.
I would appreciate any helps or advice.
Thank you
Hello Yusuke,
Using the Jira REST API can be excellent for automation and time saving tasks. There is one change I would make to your API call to test. It would be following:
curl -D- \
-u my_username@my-domain.atlassian.net:MY_JIRA_API_TOKEN \
-X GET \
-H "Content-Type: application/json" \
-H "X-Atlassian-Token: nocheck" \
https://my-domain.atlassian.net/rest/api/3/issue/PROJECT-131
Along with this, I would also ensure CAPTCHA was not been triggered on the account you are attempting to use. CAPTCHA will also results in all calls failing with a 401. Here is how to reset CAPTCHA for the user:
Click on the Gear icon in the upper right of JIRA
Select User Management
Find the right user
Click on the Reset Failed Login Countlink in the Login Details column.
Source Document: How to reset failed login count from within JIRA
Please let us know if the above assisted with resolving the issue.
Regards,
Stephen Sifers
Stephen,
Do you need the "x-atlassian-token: no-check" when you are using an API token? I am working with an integrator to consume there requests. I don't have a way to update their header, but I can create an API token. What can be done when setting no-check isn't possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.