Hello,
regarding this documentaion: https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples#ConfluenceRESTAPIExamples-Updateapage the section "Read content and expand the body" in the response there is NO version number... so how can I get this version number when I want to update certain page? How can I do this?
Community moderators have prevented the ability to post new answers.
Something like:
http://localhost:1990/confluence/rest/api/content/2064387?expand=version
expand parameter could get additional flags, specified in csv format
expand=version,body.format,history
everything you see under "_expandable" node in returned json
@Alex Medved _ConfiForms_ I am able to get all version number.I have to filter versions for latest version number Is there any way to get only latest version number using API search?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
when you do a request to the same API, and dont specify the "expand" parameter, you will get the default view/data for the page/content - it contains the version details (latest version)
Something like (see info in bold):
{
"id": "1212451",
"type": "page",
"status": "current",
...
"version": {
"by": {
"type": "known",
"username": "",
"userKey": "",
"profilePicture": {
"path": "/download/attachments/557058/user-avatar",
"width": 48,
"height": 48,
"isDefault": false
},
"displayName": "",
"_links": {
"self": ""
}
},
"when": "2018-01-20T03:59:08.505-05:00",
"message": "",
"number": 33,
"minorEdit": false,
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
curl -s --header "Authorization: Basic xXxwcG9xXxXxXxXxXxXxXx06emVydW1xd2UxMjXxXx==" \
-X GET "https://zerumbr.atlassian.net/wiki/rest/api/content/123456789?expand=version" \
| jq ".version.number"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Alex Medved _ConfiForms_ . I am looking for direct endpoint which return version no only like page/content /{contentId}/version?expand=latest. that will return only latest version. Again thanks for your reply
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.