Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,234
Community Members
 
Community Events
168
Community Groups

Adding HTML macro to a new page and inputting text from a pre-generated .html file

.. I'm New Here Aug 08, 2022

I need to create a new page that displays html from a local html file with the html macro. I know how to create the page but I can't get the HTML to work without error. I have seen this page HTML Macro - Confluence 5.5 - Atlassian Documentation but I must be doing something wrong. I get one of the following errors each time. 

< was unexpected at this time.

The system cannot find the file specified.

{"statusCode":500,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"","reason":"Internal Server Error"}

Right now to start with im just trying to get the example from the page I linked working, so I mainly need help with that, but if you also have tips on how to change it to display the html file i have instead of writing the html in the line of code that would be appreciated. 

Here is an example of what i'm trying: 

curl -L -X POST "https://confluence.gentex.com/rest/api/content" -H "Content-Type: application/json" -H "Authorization: Bearer OTY0Mjc3..." -d "{\"type\": \"page\",\"ancestors\": [{\"id\": 411198264}],\"title\": \"New page with macro attach\",\"space\": {\"key\": \"4150\"},\"body\": {\"storage\": {\"value\": \"<ac:structured-macro ac:name=\\"html\\"> <ac:plain-text-body><![CDATA[<a href=\\"http://www.atlassian.com\\">Click here</a> to see the <b>Atlassian</b> website.]]></ac:plain-text-body></ac:structured-macro>\",\"representation\": \"storage\"}}}"

 

I need it to work by pasting it in cmd prompt and I am very new to Confluence API so please keep this in mind. 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events