You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello, I am trying to authenticate to my accounts API endpoint bit it keeps failing.
IO have used the Basic AUTH (HTTPBasicAuth) and Bearer Token (Header Authentication Method) methods but they both are not working.
Please can I get some input.
Thank you
Hi @Asiya Yunusa ,
Welcome to the community!
Without the actual error message you're getting it is a bit hard to pin point the actual problem. However, here are a couple things you might want to check:
The error message you should be getting will have much more information on what is happening, so if you can share that, we should be able to give you more specific hints.
Best regards,
Oliver
Thank you!
This is the error from Postman using the Bearer Token:
{
"error": "Failed to parse Connect Session Auth Token"
}
Yes, I am using the toke generated from my account.
I am trying to authenticate to Confluence cloud
The screenshot is how I am trying to authenticate with BasicAuth
I can curl from my terminal and it is successful with
curl -v https://mysite.atlassian.net --user me@example.com:my-api-token
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Asiya Yunusa ,
I'm not that big of an expert in Python, but I believe your code does not actually sends your credentials to Confluence. Here's what should work:
EMAIL = "YOU-EMAIL"
TOKEN = "YOUR-TOKEN"
url = "https://YOUR-SITE.atlassian.net/wiki/api/v2/spaces/SPACEID/pages/PAGEID"
auth = HTTPBasicAuth(EMAIL, TOKEN)
headers = {
"Accept": "application/json"
}
response = requests.request(
"GET",
url,
headers=headers,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.