We are looking into using the REST api to create backups for all the content on our confluence cloud page. We would like this content to match the structure within confluence. Is there a simple 'view space structure' REST call to get the hierarchical structure of the pages within a space?
At the moment the only way I can think of is recursively accessing the "/content/{id}/child/page" starting with the space root page until it returns an empty list. However this could end up being a ridiculous number of requests.
Thanks for your help and I'll be happy to clarify anything.
Hi Andrew,
I think that if you use the space content API rest point(with depth=all) and expand the ancestors you will be able to collect the structure in one call
Regards,
Peter
Thanks for your help Peter. Perhaps I've not been setting up the pages correctly but my ancestors entry appears blank:
_expandable: { ... ancestors: "", ... }
I can get the descendants though of each page returned by doing:
expand=descendants.page
Unsure if this is the best of doing it but it seems to work!
Thanks for your help again,
Andrew
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.