I successfully post html code on a Confluence page. Everything is working beside the fact that the status macro of confluence is displayed in a strange table format instead of the real status macro. The rest of the html code is displayed in the correct way
My html-statement ist:
'<ac:structured-macro ac:name=\"status\" ac:schema-version=\"1\" ac:macro-id=\"4db604h0-543b-23ba-sg96-95829c2394d5\"><ac:parameter ac:name=\"colour\">Green</ac:parameter><ac:parameter ac:name=\"title\">test</ac:parameter></ac:structured-macro>'
Anyone knows what it could be?
Thank you for you answer. Actually that what you describe is what I think I do.
Therefor my confluence-table-object for example is working just fine.
It is posted in the right way.
Can you post an example how to update a Confluence-Page with the status macro via Rest-API?
Hi @Sam Miller
Try to set the representation to "storage" as given below and update space key accordingly
{
"type": "page",
"title": "My Page Title",
"space": {
"key": "MYSPACEKEY"
},
"body": {
"storage": {
"value": "<ac:structured-macro ac:name=\"status\" ac:schema-version=\"1\"><ac:parameter ac:name=\"colour\">Green</ac:parameter><ac:parameter ac:name=\"title\">Test</ac:parameter></ac:structured-macro>",
"representation": "storage"
}
}
}
-----------------------------------------------------
Create page JSON - POST /rest/api/content and update page - PUT /rest/api/content/{contentId}
Best Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sam Miller
Avoid using plain HTML. Confluence has trouble interpreting tags when they're treated as literal HTML. Instead, ensure the REST API sends these tags as part of the storage format, without wrapping them in <html> or <body> tags.
Try the correct REST API format. Structure your macro in JSON, posting it in the storage format.
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.