Getting Folders that are not Empty




  • Jason



    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:

    Hope that helps!

    コメントアクション パーマリンク
  • 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 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!

    コメントアクション パーマリンク