I'm encountering a 401 error when using the newly generated access_token to access the Jira Cloud API. After some troubleshooting, I found that I can retrieve data when accessing the link https://merico.atlassian.net/rest/api/2/myself via the web page, but the emailAddress field shows my email address before the modification. Additionally, I tried accessing the API using both the old and new email addresses along with the API token, but both attempts resulted in a 401 error.
Hello, Good day. Could you share the steps that you followed to create API token. Also provide the API end point that you are getting 401. Thanks!
Hi,Can you please share what endpoint you are trying to access and cross verify if you have access to specific project you are accessing through endpoints
The same endpoint as the web url I tested: /rest/api/2/myself
I don't think it require any additional privilege.
Tested Both curl and python script.
Tested both curl and python script.
from jira import JIRA
username = 'email'token = 'token'client = JIRA(server="https://merico.atlassian.net",basic_auth=(username, token))print(client.myself())
Thanks, I hope you are following the steps shown in https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/ to create the API token.
If possible please try once from postman, select basic auth method and use the email address and API token. Thanks!
I tried testing with Postman, but it still returned a 401 error.
It looks like you're new here. Sign in or register to get started.