You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

rk90's avatar
rk90
Helpful | Level 5
6 years ago

How to ignore folders during recursive listing

When I operate on a Dropbox Business account and list each member's personal folders, I end up listing the same shared folders multiple times. That is, if a shared folder is mounted within each member's personal folders, then when I list members' folders I end up listing that shared folder also.

I can filter out the listed shared folder if I don't use  'recursive=True', that is, I can iterate over each sub-folder and check if it's a shared folder and whether or not it was listed before, but then the disadavtage is I will have to recure through each folder manually. How can I list folders recursively and ignore certain sub-folders from getting listed on subsequent `list_folder/continue`.

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    There isn't a way to ask the API to ignore specific folders, but it sounds like this question is similar to this previous one of yours. As there, the closest thing is the 'include_mounted_folders' option on /2/files/list_folder. (You set the option when calling /2/files/list_folder, and the behavior will follow through to /2/files/list_folder/continue based on the resulting cursors.)

    Otherwise, you'd need to filter out the entries client-side, based on sharing_info.parent_shared_folder_id or sharing_info.shared_folder_id values that you've seen before. (The shared folder IDs are consistent across users.)