Posting a .html file to existing conflunce page via REST API

Pavida Intatisan November 8, 2019

I want to post .html file to confluence page that I have created earlier via REST API. I have tried this using this PUT command with the following URL:

PUT https://<confluence page>/rest/api/content/<pageID>?expand=body.storage

This works well when I am posting normal string content to the page, but does not work when I tried to post .html file to the page.

How can I post .html file to confluence page? Which API endpoint should I use?

1 answer

0 votes
Sven Schatter _Lively Apps_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 9, 2019

You can't POST arbitrary HTML into a Confluence page because Confluence is not storing its pages in HTML but their own storage format. See my answer in the thread Create macro via REST API for more details.

If you instead mean to upload the HTML file as an attachment you should use the attachment REST API.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events