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

How to send ready html document via rest api

I need to transfer some documents to confluence,
I already "convert" them to confluence format -> I can open (confluence) html editor on a new page, ctrl+a > delete all > ctrl+a (my converted html), ctrl+v > save - and document looks perfect.
But still I need to do it by opening manualy confluence editor and copy-paste my content.
I tried to put this content via curl and rest api using:

curl -u -X PUT -H 'Content-Type: application/json' -d'{"id":"3604482","type":"page","title":"new page","space":{"key":"TST"},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}},"version":{"number":2}}' | python -mjson.tool 

and for one line ex. "<p>This is the updated text for the new page</p>" it works well, but for my 140 lines html it doesn't... I also tried to put it into json file, but every ( " ' , ) breaks json syntax and escaping that will consume to much time...
Is it possible to sent it somehow?
Like I said I've got ready-to-paste html content in my file, how to put it via rest API ?

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

278 views 9 6
Join discussion

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