Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can i get the page version using a specific page id?

Asam Malik September 24, 2018

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.

 

1 answer

2 votes
Shawn C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 25, 2018

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

HONG LY September 17, 2019

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events