Update page content having css styles with REST API

alex April 14, 2022

Does anyone know how to update the page content (with CSS style class) using the REST API. I have a requirement to programmatically update a confluence page using the REST API. The content i have is HTML. It all works fine except for what is specified in the <STYLE> tag. The <STYLE> tag gets completely stripped off. An example of what I tried is below.

 

"body": {
        "storage": {
            "value""<style>.intro {background-color: yellow;}</style><p><div class=\"intro\">CSS Test</div></p>",
            "representation""storage"
        }
    }


Please note that I am able to get the styles working if I define the syle within the element. I am looking for a way to get it working by defining the style in the <style> tag so that I can reuse it.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events