Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Method to delete page and children with rest api? Edited

I want to automate deleting certain pages that don't meet certain criteria using the rest api.

At the moment, I have a recursive function that get the children of a page and deletes them using a rest call:

rest.delete(baseUrl + "/content/" + pageId, user, pw);

Using this call, I have to make an API call for every page, which takes ~250 ms per call.
This is too slow for my liking when I have to delete a couple hundred pages.

Is there a way to delete a page and it's children with ONE API call?

1 answer

0 votes
Thomas Deiler Community Leader Apr 23, 2021

Dear @Nils Schieschke ,

unfortunatelly the rest api has no bulk delete, but you could speed up the recursive deletion when you fork your process for each leaf you have reached.

Example: Your top parent page has three children. For each of its child you start the recursive function in a news fork/thread. And so on.

Concurrent REST calls should be possible. If there is a limitation (I doubt), start the fork/threads with different system users.

So long

Thomas

Hey Thomas,

while running the deletion in parallel would of course help, the process will not be run threaded, so that is sadly not a viable option.

Thanks,
Nils

Thomas Deiler Community Leader Apr 27, 2021

Dear @Nils Schieschke ,

I think the interesting aspect is, that you can fire (thread) the rest call without waiting for its return.

This would result in a (more or less) synchronos deletion of a page tree. The limit will be maxThreads (of server.xml).

So long

Thomas

Like Nils Schieschke likes this

Hey @Thomas Deiler ,

you're right, I didn't even think of that.

Thank you!

Thomas Deiler Community Leader May 05, 2021

Dear @Nils Schieschke ,

don't forget to press the "green accept answer" button to indicate other readers the successful answering of your question.

Thanks
Thomas

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

🥓🙅🏻‍♀️ Meet-less May Badge!

Hello Confluence Community!  What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. We la...

208 views 2 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you