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

request.get() for page content and metadata returns 403

I am attempting to automate some file uploads to a confluence page using python. I have been following this guide and was able to upload the attachment to /rest/api/content/att{ID}, but, I am stuck retrieving the page content and metadata. The code I'm using is:

headers = {"X-Atlassian-Token": "nocheck", "Accept": "application/json"}

page_output = requests.get("https://{base_url}/api/content/{Page_ID}?expand=space, metadata.labels", headers=headers, auth=('user', 'api-token'))

 

I have also tried using the same code without the expand, as well as expand=body.storage,version,space. However, I keep getting a 403 error, even though I am entering my user and api_token. If I put in the same url in the browser, I can see all the data there, just not when I run it in my terminal.

Any thoughts on why I might be getting this error would be greatly appreciated.

1 answer

1 accepted

0 votes
Answer accepted

So, I think it was an issue with my vpn. New day, fresh login, and now my code is working. I also discovered that I have to have the wiki included in my url. Otherwise, I receive 404 errors...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events