Example API call to get content - https://<domain>/rest/api/content/12345
I'm not able to find out a way to get the whole content body. Although, this
{"webui":""...}
gives the URL to get the actual content on the browser, is there no way to get the actual html content in the JSON response itself?
Hi,
You could read the content of a page with the body expanded.
https://<domain>/rest/api/content/12345?expand=body.storage
Please refer to the Confluence REST API examples for more details: https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/
That was very helpful!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome. 👏 this worked for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How can you search for the content ID?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want the page ID, go to Tools --> Page Information on the particular page you are interested in. You should see the page (content) ID shown in the URL when you do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It no longer works. Seems like:
1. The ability to programmatically (using the Forge API) to access a prior version of a page no longer works.
2. The ability to obtain the _content_ of a prior version of a page, even by entering the URL query in a browser, no longer works.
E.g., this does not work using Forge:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Cliff Berg
Thank you for the update. The API is designed for Confluence Server and Data Center, and not for Confluence Cloud. I have performed a quick test and can confirm that it is still functional in Confluence Server/DC 7.19 LTS.
Best,
Lei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply. That clarifies things.
Does that mean that for Confluence Cloud, there is no way to obtain the actual content of an earlier version of a page?
I just tried these in a browser, and the body field that is returned is an empty string (but the actual body should not be empty):
https://agile2academy.atlassian.net/wiki/rest/api/content/7208974/?body-format=storage&version=37
I also tried this,
https://agile2academy.atlassian.net/wiki/api/v2/pages/7208974/versions/37/
but the response does not even have a body field.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Cliff Berg what worked for me was using this:
...../wiki/api/v2/pages/1234567?body-format=ATLAS_DOC_FORMAT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, that helped a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.