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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

1 vote
Shawn C Atlassian Team Sep 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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- 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...

323 views 23 8
Join discussion

Community Events

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

Events near you