Confluence API to fetch the documentation content

Is there any API to fetch the contents of a page in Confluence? I have tried using the expand body option in pages API but that doesn’t return the actual content of the page that we see in the Confluence UI.

Is there any alternate option/ API to fetch the above said data?

1 Like

Hi,
If you want to see the content of the page in confluence use: ?body-format=ATLAS_DOC_FORMAT
Example:
https://your-domain.atlassian.net/wiki/api/v2/pages/id?body-format=ATLAS_DOC_FORMAT

In documentation https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-get you can see it under Query parameters / body-format

I have tried this out but it doesn’t give the actual page content that we see in the Confluence UI. There are documentations there in pages inside spaces, we want to fetch that documentation content using API. Is it possible?

If I understand correctly, you want to get the documents attached to the confluence page.
Unfortunately, for that, you will have to use a separate api:
Api V1 (Depracated):
your-domain.atlassian.net/wiki/rest/API/content/id/child/attachment
Api V2:
https://your-domain.atlassian.net/wiki/api/v2/pages/id/attachments