Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Upload an image to a page using the REST API Edited

Rob Bell I'm New Here Oct 26, 2020

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&colon;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?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

113 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you