The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to send ready html document via rest api

Kacper Nietuzinkovy
November 7, 2019

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 admin@example.com:api_token -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}}' https://your-domain.atlassian.net/wiki/rest/api/content/3604482 | 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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events