The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Rest API to return pages sorted by position

Venkat P
January 30, 2019

I am using the Confluence API to retrieve children of a parent. The following API call returns the children of a Page with Id 123456, ordered by last modified date.

rest/api/content/search?cql=parent=123456+order+by+last-modified

 

I noticed that the following call returns results by position, however, I could not find a REST API equivalent for this:

https://wiki.xyz.abc.com/pages/children.action?pageId=123456

 

Any suggestions?

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 1, 2019

Hello Venkat and welcome to the Community!

Since you want to see the page tree with the order of the pages intact, then you will need to use a different REST API endpoint. The endpoint you want to use is the  follows;

GET /rest/api/content/{id}/child

Source document: GET /rest/api/content/{id}/child

Using this endpoint, you will need to append the following to your call to ensure you get only pages returned

?expand=page

A full example call would look similar to:

http://localhost:8090/rest/api/content/CONTENTID/child?expand=page

You will need to place the parent page ID where the CONTENTID is. The results will be in page tree order of the parent.

I hope this proves helpful and you're able to access the data you need.

Regards,
Stephen Sifers

Venkat P
February 3, 2019

Thank you very much Stephen! This is perfect :)

Like Stephen Sifers likes this
TAGS
AUG Leaders

Atlassian Community Events