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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.