I'm trying to use the Confluence REST API to create a page containing an image. I've tried a few different things without success but thought I might be on to something by base64 encoding an image and setting it as the source for an image tag in the page HTML, but although Confluence appears to create the page successfully, it doesn't display the image and appears to strip it out.
curl -u user:pass \
-X POST \
-H 'Content-Type: application/json' \
-d '{"type":"page","title":"new page 123",
"space":{"key":"DEVELOPMEN"},"body":{"storage":{"value":"<img src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\" />","representation": "storage"}}}' \
https://robbell.atlassian.net/wiki/rest/api/content | python -mjson.tool
Is there a more sensible approach that I'm missing?
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.