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
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.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.