Getting metadata from "Page Properties Report Macro" via REST API

Evangelos Mantadakis May 8, 2019

Would it be possible to get the HTML content of the"Page Properties Report Macro" using a REST API call ?

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2019

Hello Evangelos,

Using the REST API to get the content of a page is simplified by adding an expand to the end of your API URI. This may look something as follows:

http://example.com/confluence/rest/api/content/1234?expand=space,body.view

Using the following endpoint: GET /rest/api/content/{id}

This will allow the response to include the following within the response which will include any macros you have present:

"body": {
       "view": {
           "value": "<p><h1>Example</h1>Some example content body</p>",
           "representation": "view",
           "_expandable": {
               "content": "/rest/api/content/1234"
           }
       }

I hope this proves helpful and you’re able to grab the content of your Confluence pages and macros without issue.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events