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 <span>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. </span>
<span>Any thoughts on why I might be getting this error would be greatly appreciated.</span>