Forums

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

JIRA API 401 Error

Aaron Krawitz
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!
February 2, 2023

I'm attempting to connect via Postman using Basic Auth. Here is the basic information:

1) GET https://mycompanydomainhere.com/rest/jira-email-processor-plugin/1.0/mail/audit/connectivity

2) Authorization: Basic Auth

3) Username: The email I use to login to Atlassian

4) Password: An API token I created

 

Using this information, I keep getting a 401 error telling me I'm unauthorized. Am I doing something wrong, or is it possible I need to have my account with Atlassian flagged for permission to call this endpoint?

 

 

2 answers

3 votes
other surfing
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!
February 2, 2023

Jira no longer uses basic auth, you need to use bearer & Token. Also I think that api link only works for admin accounts.

Aaron Krawitz
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!
February 2, 2023

I see. So regarding the bearer/token, can I just use the API token I created as the bearer token? Also, do you have a list of endpoints I can access so I can test other endpoints in case that particular link is admin only?

Thank you!!

1 vote
maxim
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!
February 6, 2023

I'm also having the same issue following https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/

Using curl -u email:api-token I've got this response:

 

HTTP/2 401
date: Tue, 07 Feb 2023 06:46:47 GMT
content-type: text/plain
server: AtlassianEdge
expect-ct: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/atlassian-proxy", max-age=86400
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
atl-traceid: 96ac07758f1fb01d
report-to: {"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}
nel: {"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}
strict-transport-security: max-age=63072000; includeSubDomains; preload
vary: Accept-Encoding

Basic authentication with passwords is deprecated. For more information, see: https://developer.atlassian.com/cloud/confluence/deprecation-notice-basic-auth/

 

I don't use my password, I use the API token.

 

maxim
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!
February 6, 2023

Just made it work.

Have to revoke + issue a token and it works as described in the docs, using header `Authorization: Basic <email> <token>`

It seems the token is somehow connected with my profile email address that I've changed after creating the first one.

Like Kseniia Trushnikova likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events