Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Retrieve content of all descendants via REST API

suedti1 October 19, 2021

Hi all!

 

I´m trying to retrieve the storage content of all descendants (3 levels) of a page.

 

If I use this URL I get alls descendants up to level 3 but the body content is shown only for the last level. 

/rest/api/content/1512637511/child?limit=999&expand=page.children.page.children.page.children.page.body.storage

What would be the correct URL to get the body content of all pages?

 

Thanks a lot

1 answer

0 votes
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2021

Dear @suedti1 ,

you can write your request recursively - its a tree.

Start with the first top level page an get all its children pages:

GET /rest/api/content/{topLevelPageId}/child/page

now you have all the children ids for getting the whole page in details:

GET /rest/api/content/{childId}

for each child you repeat these steps until you reached the desired depth.

So long

Thomas

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.0.2
TAGS
AUG Leaders

Atlassian Community Events