Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Szymon D.'s avatar
Szymon D.
New member | Level 1
9 years ago

files/list_folder API returning subfolders before parent folders

Most of the times the list_folder API returns parent folders before subfolders, but I've somehow managed to get it otherwise (I can't remember the sequence of folder operations that I performed, but it included moving, removing, un-removing and renaming). This is the example:

{ ".tag": "folder", "name": "abc", "path_lower": "/ttts/abc", "path_display": "/ttts/abc", "id": "id:l5CE9n6dddAAAAAAAAAACg", "shared_folder_id": "1188003718", "sharing_info": { "read_only": false, "shared_folder_id": "1188003718" } },

{ ".tag": "folder", "name": "ttts", "path_lower": "/ttts", "path_display": "/ttts", "id": "id:l5CE9n6dddAAAAAAAAAAEg" }

 

Is this normal to expect or rather an unexpected/buggy situation ?

2 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    The order isn't guaranteed by /list_folder, so either way can occur. The guarantee is just that you'll get a correct representation of the state if your app processes all of the entries in the order given. Your app can then apply whatever sorting it wants once it has the entries.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!