Hi Atlassian Team,
I generated API Token, following this documentation Link
I used that token and the email which generated the token to get audit records, following this documentation Link
I used Python code, the same as documentation
But it returned 401 Unauthorized error and a message "Client must be authenticated to access this resource."
Then I added Authorization to header of the request.
auth_key = base64.b64encode(b"email:pass").decode("ascii")
headers = { "Authorization": "Basic " + auth_key}
Or without encoding base64
headers = { "Authorization": "Basic " + token}
It still returned the same error.
I've already double checked the email and token. There is no mistake.
Did I miss anything ?
Thanks and best regards,
Ngan Tran.
Welcome to the community. Please refer to the following reference links to assist your trouble shooting of your issue -
https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/
Hope this helps.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
Thank you. It worked.
It can only run with personal access token, not organization api token.
Thanks and best regards,
Ngan Tran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.