Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,728
Community Members
 
Community Events
185
Community Groups

API Authentication failing

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 

1 answer

1 accepted

1 vote
Answer accepted
Oliver Siebenmarck _Polymetis Apps_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 22, 2023

 

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 BasicAuthconf.png 

I can curl from my terminal and it is successful with

curl -v https://mysite.atlassian.net --user me@example.com:my-api-token
Oliver Siebenmarck _Polymetis Apps_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 22, 2023

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=(",", ": ")))
Hope that helps,
 Oliver

Thank you! :) It working now

 

Asiya

Suggest an answer

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

Atlassian Community Events