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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
from jira import JIRA
username = 'email'
token = 'token'
client = JIRA(
server="https://merico.atlassian.net",
basic_auth=(username, token)
)
print(client.myself())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried testing with Postman, but it still returned a 401 error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. This looks correct. To make sure this API token is created from the same user account?. Could you generate a new token and check the status?
What happens when you try different end point, like to GET a specific work item?
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.