How to render content using Confluence REST API


I am trying to create a React project to display page content from a Confluence page.
However, the response to APIs like wiki/rest/api/content/{contentId} gives an adf document which is not able to load media and macros because the internal api calls to fail with error.

Is there some library I need to use along with atlaskit to ensure success in internal api calls?


Hi @SpandanRoy, as for getting the content of a page in a different format, try using the expand=body.view query parameter in your request URI. That result payload will include page content rendered in HTML. More info on expand options can be found in the docs.

Can you elaborate on what you mean by internal API calls?

Hi @nmansilla,

I have tried using expand=body.view but it returns incomplete css.
Hence I’m using body.atlas_doc_format which returns an adf document corresponding to the page which I’m rendering to HTML using @atlaskit/renderer.

By internal api calls, I mean api calls to when renderer tries to load media on my app. Text content seems to load fine but media doesn’t load and I see repeated attempts to this API fail in Network Tab of dev tools.

Please let me know if I need to share further details.

Bumping this up for visibility. @nmansilla, could you please help out here?