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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.