Posting HTML on Confluence using Python

Hung Tu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 2, 2022

I am on Confluence server and I am trying to post a Dynamic HTML file onto Confluence through python script. I know this HTML works because it shows up when being posted using editor with the default HTML macro.

However, I need to automate this process therefore I am using Python Script. So far I was able to use the Python REST API library to create a page and post simple HTMLs. I got the HTML macro to work as well using this storage format:

"""<ac:structured-macro ac:name="html"><ac:plain-text-body><![CDATA[ {the HTML} ]]></ac:plain-text-body></ac:structured-macro>"""
But when I go to post the this dynamic HTML that has JS and CSS, nothing shows up. When I open the editor of this page, the correct content inside HTML macro is there. This is strange for me and I am not sure where to go from here. Any help is appreciated! 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events