Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence Getting macro output via REST API

xigaha April 12, 2022

We are displaying page content using confluence rest api and several macros in the page. So when getting the page content using api we are not getting the macro content. Also tried the endpoint which is in docs but not getting the desired output

/wiki/rest/api/content/{id}/history/{version}/macro/id/{macroId}

The response returned is this and has body as empty

{
    "name": "contentbylabel",
    "body": "",
    "parameters": {
        "showLabels": {
            "value": "false"
        },
        "max": {
            "value": "5"
        },
        "spaces": {
            "value": "com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@273c92"
        },
        "sort": {
            "value": "modified"
        },
        "showSpace": {
            "value": "false"
        },
        "reverse": {
            "value": "true"
        },
        "type": {
            "value": "page"
        },
        "cql": {
            "value": "label = \"kb-troubleshooting-article\" and type = \"page\" and space = \"TEST\""
        },
        "labels": {
            "value": "kb-troubleshooting-article"
        }
    },
}
So how to display macro content in the page

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events