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.
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:
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.
- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events