I'm trying to append content to an existing confluence wiki page. So far, I can see only PUT exists and it overwrites the whole page.
I also tried to pull the existing content, then append the changes automatically locally and then push again but for some reason, all the emojis/icons replaced with a blue star...
Extract data for edit:
response = requests.get("https://<compnay>.atlassian.net/wiki/rest/api/content/" + page_id + "?type=blogpost&start=0&limit=10&expand=body.view",
auth=(email, apitoken), verify=False)The PUT code example:
new_headers = {
'Content-Type': 'application/json',
}
data = r'{"id":"' + page_id + '",' \
'"type":"page",' \
'"title":"' + page_title + '",' \
'"space":{"key":"' + workspace + '"},' \
'"body":{"storage":' \
'{"value":"' \
'' + full_code + '<p />",' \
'"representation":"storage"}},"version":{"number":' + str((int(version_number) + 1)) + '}}'
response = requests.put('https://<company>.atlassian.net/wiki/rest/api/content/'+page_id, headers=new_headers,
data=data, auth=(email, apitoken))Which brings up 2 questions:
More Important: How is it possible to append content to an existing wiki page, without overwriting or deleting the existing content within it?
Less Important: Why the emojis changed to blue star? How can I avoid it?