Hi,
I'm creating a new version of the page after attaching a pdf doc. using a REST api. But seeing 500 Server Error: Internal Server Error for url:rest/api/content/<contentid>
Below is the snippet:
new_content = f'{current_content}<ac:structured-macro ac:name="viewpdf"><ac:parameter ac:name="name">att190068</ac:parameter></ac:structured-macro>'
print(new_content)
update_url = f'{confluence_url}/rest/api/content/{page_id}'
print(update_url)
payload = {
"version": {"number": version_number + 1},
"title": page_data['title'],
"type": page_data['type'],
"status": "current",
"ancestors": [
{"id": 123456} ],
"body": {"storage": {"value": new_content, "representation": "storage"}}
}
print(payload)
# headers['Content-Type'] = 'multipart/form-data'
response = requests.put(update_url, auth=(username, password), headers=headers, data=payload)