Steps to reproduce -
def update_with_attachment(page, space, version):
data = {
"type": "page",
"title": title,
"id": page,
"space": {"key": space},
"body": {
"storage": {
"value": '<ac:image><ri:attachment ri:filename="image.png">\n</ri:attachment></ac:image>',
"representation": "storage"
}
},
"version": {"number": version}
}
response = requests.put(url, json=data, auth=auth)
Expected result -
A 200 Response
Actual result -
com.atlassian.confluence.api.service.exceptions.InternalServerException: java.lang.RuntimeException: com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageUnmarshalXhtmlException: java.lang.UnsupportedOperationException
Workaround:
Remove the newline character from
<ri:attachment ri:filename="image.png">\n</ri:attachment>
Hello there @Andrew Marshall!
As I understand, you need to create a new line after the attachment you created. I also believe that you are trying to do so via REST, is that correct?
The way you added the newline character shows us that the \n was added as if it was inside the attachment structure, not after it.
You can try adding the \n after the attachment structure. You can check more details about REST API here:
Let us hear from you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.