I am using a bash script to update a specific confluence page. In order to actually make the update, I need to retrieve the current page version. I have tried to do this using this command:
curl -X GET "https://<site>/rest/api/content/pageID?=version"
But this doesn't return the version only, it returns a lot of other stuff that is not useful to me? What is the easiest way to retrieve a version of the page? I am new to using confluence so if I am making a newbie mistake, please let me know.
Hi Asam,
The Confluence API can provide the full JSON of the page you're viewing and cannot pull just the value corresponding to the Number of Versions on the page.
If you're looking at updating a page in Confluence, you might want to query the endpoint:
/rest/api/content/pageID?expand=body.storage,version
This would provide you with the necessary Body Content (storage) of the page and the version number (to be incremented) to be used in the Data Payload when using PUT to update the page.
Regards,
Shawn
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.