Join BoxWorks in San Francisco Nov 12-13! Keynotes, product demos, and Box Master Classes. Reserve your spot!

Getting Folders that are not Empty

Answered
New post

Comments

2 comments

  • Jason

    Hi,

     

    That understanding sounds correct. You can theoretically use the "item_collection" or even "size" field on any individual folder to see if that particular folder is empty or not, but the API doesn't offer a way to do something like "give me all non-empty folders underneath this parent folder".

    As for the rate limits, that sounds correct but the logic could be simplified if you're using our SDKs. The SDKs will go as fast as either your code or the rate limits allow, and automatically handle things like retries and backoffs. 

    Finally, there's a slightly different pattern that I sometimes see - rather than a periodic scan and sync, I've seen developers do an an initial scan and then listen for events via the User events stream:

    https://developer.box.com/guides/events/for-user/

    Hope that helps!

    0
    Comment actions Permalink
  • JC

    Thanks Jason for confirming!  I think the approach I am going to take is using a webhook to keep most of the folders and files up to date and then just run a sync once a day late at night to make sure nothing was missed.  I really like how box.com retries multiple times if the web hook doesn't respond which makes it nice if the web service goes down unlike an API like slack that just tries one time and it is done!

    Thanks again for the reply!

    1
    Comment actions Permalink

Please sign in to leave a comment.