You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Experimentally, I am finding that the order of the items in the response to a `GET /wiki/rest/api/content/{id}/child` API call is the same as the order in which they appear in the WEB UI.
The API documentation does not actually say anything about the order though, so I am nervous about relying on that.
If the order cannot be relied upon, I see that there is a `position` extension in the results that seems to represent the display order, but that is not mentioned in the API documentation, so I don't know if I can rely on its meaning or continued existence.
Can all of this be clarified in the documentation?
Hi Steve,
I'm not sure if I got your question right, so I'd like to ask for more details on what exactly is this position and display order of results you mentioned and what are you looking to clarify.
Would be the ones under for example:
And what is shown under the expandable, such as body, for example?
The link to the documentation along with additional information for your use case would be useful for us to understand your concern a little better. :)
Assuming that you are trying to follow the REST API Get content children with the provided path:
page
: child content is page
, comment
, attachment
blogpost
: child content is comment
, attachment
attachment
: child content is comment
comment
: child content is attachment
So, in order to retrieve for example, all comments in the specified page, you could use the following:
https://<sitename>.atlassian.net/wiki/rest/api/content/<pageID>/child/comment?expand=body.view
For reference, all other expendables are listed here: Get content children by type
Hope that helps, but in case you concern is a bit different, please let us know.
Cheers,
Jessica
Thanks for replying.
No. That's not exactly what I'm asking.
In this case, I am actually getting child pages of a page (so https://<sitename>.atlassian.net/wiki/rest/api/content/<pageID>/child/page) and I'm talking about the order in which the child pages appear in the content array in the response data.
I need to know the order that the child pages appear when viewed through the Web UI. Experimentally, it seems that the items in the content array are the same as the order in which they appear in the Web UI, and each item in the response also contains an `extensions.position` value (not an expandable) with values that are in ascending order (though not sequential) corresponding with the position.
Neither the order if entries in the response nor the meaning of that extension appear to be mentioned in the documentation, so I don't know whether I can rely on either of those.
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.
Thank you for the clarification and my apologies for the delay getting back to you, Steve!
I got it wrong at first, but after some tests here, I can confirm to you that all results switching pages in the hierarchy in UI, reflected in the API indeed, like in your tests shared in the other thread.
Although it is not sequential, the lower the number in the position is, result, higher the page is in the hierarchy under that specific parent page.
Moving the pages in the UI, confirmed that as well.
Regarding the documentation, we indeed do not have it covered in the our REST API documentation.
Thank you for bringing it to our attention! I have contacted our developers about this information not being there and we will be reviewing internally together, to see if this is possible to be added to our official documentation.
Hope this helps with your question!
Jessica
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.