My goal is to retrieve HTML rendered Confluence pages via the REST API in order to display pages outside from Confluence.
To achieve this the content is retrieved in storage format:
https://confluence/rest/api/content/62030518?expand=body.storage
The storage format looks like:
<ac:image ac:height=\"250\"><ri:attachment ri:filename=\"hqdefault.jpg\" /></ac:image>
Then the field "body.storage.value" is taken as input for the content body convert resource:
https://confluence/rest/api/contentbody/convert/styled_view
Excepted the embedded images, the pages are rendered correctly, including oder macros like JIRA issue macros. However, for images the HTML looks like
<img src=\"/plugins/servlet/confluence/placeholder/error?i18nKey=editor.placeholder.broken.image&locale=en_GB&version=2\" title=\"\" class=\"transform-error\" data-encoded-xml=\"%3Cac%3Aimage+ac%3Aheight%3D%22250%22%3E%3Cri%3Aattachment+ri%3Afilename%3D%22hqdefault.jpg%22+%2F%3E%3C%2Fac%3Aimage%3E\" />
According the HTML image tag there was an transformation error. Does it mean that images could not be rendered at all?
Is there a solution, e.g. fetching images first and then somehow correct broken links?
Hello David,
Glad to see you are getting some great use out of the Confluence REST API. We did see a similar issue reported as a bug (CRA-603) which has been resolve in Confluence 5.8.
With this said, which version of Confluence are your presently running?
Are the errors you are seeing from images not attached to the page you are calling?
We want to attempt to re-create your error to see if it might possibly be a bug.
Regards,
Stephen Sifers
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.