I can access the confluence page content through the endpoint - rest/api/content/{id}?expand=body.storage.
The response of the above endpoint is in HTML format. I need the response in the JSON format or any easy way to convert the body to JSON format?.Any help would be much appreciated.
Hi @mohammedafzal
The content of Confluence pages can be quite complex. It does not only contain flat text but also macros, formatting details, layouting, ... If you expect the API to return only the text and nothing else I'm afraid it has not been foreseen in the API.
Here is a suggestion: try using the new v2 API. You also have to choose a storage format with a query parameter:
<base-url>/wiki/api/v2/pages/<page-id>?body-format=atlas_doc_format
Options are:
Here is the v2 API documentation: https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get
I hope this helps at least a bit!
We have a self deployed instance of Atlassian tools on premises. <base-url>/wiki/api/v2/pages/<page-id>?body-format=atlas_doc_format -- when we test this endpoint, it is throwing 404. Anyother solution would help.Thanks for your quick support.
I'm sorry. For some reason I thought you were on Cloud.
I don't think there is anything similar of on premise solutions.
It looks like you're new here. Sign in or register to get started.