I am trying to update a Confluence page with some HTML content. I have this HTML content in a different file named Output.html
in the same location. I cannot directly copy & paste that HTML content to this script, as it is a huge amount of data, and also I need to execute this script dynamically.
curl -u user:pass -X PUT -H 'Content-Type: application/json' -d'{"id":"2196","type":"page","title":"Main page","space":{"key":"AB"},"body":{"storage":{"value":"<p> Text </p>","representation":"storage"}},"version":{"number":2}}' https://Client.atlassian.net/wiki/rest/api/content/2196 | python -mjson.tool
For example, my HTML file content is as follows:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>
I need this to be updated on my Confluence page as HTML content, which needs to fetched directy from the HTML file to the script "value":"<p> Text </p>"
When I manually copy sample HTML content to this value
space, the page successfully shows the HTML content.