Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a page with base64 embedded image via REST API?

krivonos January 2, 2022

Hi all,

I use REST API to create pages in my Confluence server. It works fine for simple text, but if HTML text posted to the server contains base64 image, the POST operation finished well, but created page doesn't contain the image code. It is simply cut. Of course, created page doesn't show the image.

In the source it is like that:

<img src="data&colon;image/png;base64,iVBORw0KGg (many symbols here)=" />

Please, help.

1 answer

1 accepted

1 vote
Answer accepted
David at David Simpson Apps
Atlassian Partner
January 4, 2022

Yeah, that's not going to work.

It's a nice idea and I'd like it to work, but images need to be separate to content. Maybe upload as an attachment, then add the image to point to the attachment.

krivonos January 6, 2022

Yes, I did it. Now I have 3-steps page creation: 1) create a simple page just in order to know its ID; 2) upload images as attachments with already known page ID; 3) update page with its full content and references to attachments.

It isn't very nice and I would like to create a page with images in just one step, but I don't have another solution.

Anyway I have this workaround, it is better than nothing.

Aresky Bandera
Contributor
February 20, 2024

Hey, was this approach using base 64 images? 
I'm trying to get that done but the only solution I can see is to parse it to an actual image and then upload it as an attachment. 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence whiteboards, whiteboard templates, template contest, visual collaboration, atlassian learning, confluence community, brainstorming tools, agile planning, team productivity, confluence templates, share your template

Share Your Confluence Whiteboard Template for a Chance to Be Featured in the Product! 🏆

Want to leave your mark on Confluence? One winner will have their whiteboard design added into Confluence for all users to access! This is your chance to showcase your creativity, help others, and gain recognition in the Confluence community.

Share your template today!
AUG Leaders

Atlassian Community Events