Get Body of a Page through API v2

I am referring to
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get
To get a page through API v2. But I am unable to access the body. As far as I understand the command should be : <domain_id>/wiki/api/v2/pages/{id}/body

But this does workout and I get “page does not exist” error.

For API v1, the request is <domain_id>/wiki/rest/api/content/{id}?expand=body.storage
This does work.

Is this not support in API v2 yet or am I missing something ?
Thank you

Hi @SarthakKapoor,

as per the documentation you need to add the body-format parameter and supply either storage or atlas_doc_format as a value depending on the format you want. So, the following should work:

/wiki/api/v2/pages/{id}?body-format={storage|atlas_doc_format}

Have you tried that?

Cheers,
Sven

1 Like

Yes, this works.
Thanks @SvenSchatter !

1 Like

This is marked as a solution, but the actual body format for atlas_doc_format is a sort of ‘escaped’ JSON which is not usable as JSON. For storage it is XML. How do you turn either into usable JSON?