Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
sixdesign
7 years agoExplorer | Level 4
Retrieve all files in App shared folder (respecting folder tree)
Hi! I'd like to display all files of from a shared folder, using DropBox API respecting my folder hierachy. I followed 2 different ways : 1) My first idea was to use the files/list_folder endpoint ...
- 7 years ago
Hi! Happy to help. A couple clarifying questions:
- Could you clarify what you mean by 'respecting folder heirarchy'?
- What is the final way you want your files displayed?In general, your #1 solution is the better way to go. I reccommend continuing to iterate on that solution.
A response from a successful list_folder response will typically look like this:
{ "entries": [ { ".tag": "file", "name": "Prime_Numbers.txt", "id": "id:a4ayc_80_OEAAAAAAAAAXw", "client_modified": "2015-05-12T15:50:38Z", "server_modified": "2015-05-12T15:50:38Z", "rev": "a1c10ce0dd78", "size": 7212, "path_lower": "/homework/math/prime_numbers.txt", "path_display": "/Homework/math/Prime_Numbers.txt", "sharing_info": { "read_only": true, "parent_shared_folder_id": "84528192421", "modified_by": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc" }, "is_downloadable": true, "property_groups": [ { "template_id": "ptid:1a5n2i6d3OYEAAAAAAAAAYa", "fields": [ { "name": "Security Policy", "value": "Confidential" } ] } ], "has_explicit_shared_members": false, "content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" },
// other entries
];The property named 'path_lower' (or path_display) contains the explicit path to your file. Those strings contain all the information about where your file lives in relation to your folder heirarchy.
You can either parse the string manually (using a built-in method like `split('/')`) or bring in a module to help work with the path. In both cases you should be able to use the path information to handle your files according to that heirarchy.
TaylorKrusen
Dropbox Staff
7 years agoHi! Happy to help. A couple clarifying questions:
- Could you clarify what you mean by 'respecting folder heirarchy'?
- What is the final way you want your files displayed?
In general, your #1 solution is the better way to go. I reccommend continuing to iterate on that solution.
A response from a successful list_folder response will typically look like this:
{
"entries": [
{
".tag": "file",
"name": "Prime_Numbers.txt",
"id": "id:a4ayc_80_OEAAAAAAAAAXw",
"client_modified": "2015-05-12T15:50:38Z",
"server_modified": "2015-05-12T15:50:38Z",
"rev": "a1c10ce0dd78",
"size": 7212,
"path_lower": "/homework/math/prime_numbers.txt",
"path_display": "/Homework/math/Prime_Numbers.txt",
"sharing_info": {
"read_only": true,
"parent_shared_folder_id": "84528192421",
"modified_by": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
},
"is_downloadable": true,
"property_groups": [
{
"template_id": "ptid:1a5n2i6d3OYEAAAAAAAAAYa",
"fields": [
{
"name": "Security Policy",
"value": "Confidential"
}
]
}
],
"has_explicit_shared_members": false,
"content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
// other entries
];
The property named 'path_lower' (or path_display) contains the explicit path to your file. Those strings contain all the information about where your file lives in relation to your folder heirarchy.
You can either parse the string manually (using a built-in method like `split('/')`) or bring in a module to help work with the path. In both cases you should be able to use the path information to handle your files according to that heirarchy.
- sixdesign7 years agoExplorer | Level 4
Hi! Thanks for the help!
You definitely right. Split the 'path_lower' will do the job to recreate the folder hierarchy.
By 'respecting folder hierarchy' I don't know how to explain ^^ but I'd like to display something like :

Thank you very much for your quick reply!
- Greg-DB7 years ago
Dropbox Community Moderator
Thanks for following up and clarifying! I'm glad Taylor was able to help. Yes, to reconstruct the folder hiearachy like that, you'll want to split the path on "/".
For reference, whenever you're going to display the path to the user, you should use the "path_display" value. Whenever you're using the path to make another API call though, it's best to use the "path_lower" value.
- sixdesign7 years agoExplorer | Level 4
Thanks Greg K. for that clarification. That makes sense for me using "path_lower" to request the API if needed. But good to know.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!