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.
Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋♀️ ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.