Start 2025 on time and up to date. Seamlessly integrate your calendars into Dropbox with these simple steps.
Forum Discussion
satish bhuktar
5 years agoExplorer | Level 4
how to get all subfolders list from the share section of dropbox?
02-18-2019 05:18 AM
Hello. Does anyone know how to get all subfolders list from the share section of dropbox?
I am using .Net SDK
When I am trying to get a shared folder it gives me by using the below method.
dropbox.Sharing.ListFoldersAsync();
but when I need only particular folders subfolders(like all subfolders in XYZ folder) then it's not accepting path as an input parameter, How can I get a list of subfolders from a folder from share section of dropbox.
I am working on a c# app that should browse folders by double-clicking it like our windows folders.
var dropbox = new DropboxClient by the way.
I'm not sure I understand the first part of your latest comment. If something isn't working as expected with the Dropbox API with respect to that, please clarify.
Anyway, yes, you can check if a given shared folder is mounted in the connected account. Check the SharedFolderMetadata, e.g., as returned in ListFoldersResult.Entries from ListFoldersAsync or ListFoldersContinueAsync. If SharedFolderMetadataBase.PathLower is set, then the folder is mounted. If it is not set, then the folder is not mounted.
- Greg-DB
Dropbox Staff
The Sharing.ListFolders methods only let you list shared folders themselves. To list the contents of any arbitrary path, you need to instead use Files.ListFolder and Files.ListFolderContinue methods.
- satish bhuktarExplorer | Level 4
Hi Greg,
is Files.ListFolder able to return a list of subfolders of the folders that shared with me but not mount yet? I was trying it but was giving exception of the path not found, that's why I was using Sharing.ListFolderAsync(), what am I need to do here
- Greg-DB
Dropbox Staff
Yes, you can technically use these methods to list the contents of an unmounted folder. To do so, you need to use the 'Dropbox-API-Path-Root' header with the "namespace_id" mode, set to the namespace ID of the folder, which you can get from the Sharing.ListFoldersAsync method.
In the .NET SDK, that would look like this:
string ACCESS_TOKEN = "..."; string namespaceID = "123456789"; client = new DropboxClient(ACCESS_TOKEN).WithPathRoot(new Dropbox.Api.Common.PathRoot.NamespaceId(namespaceID)); var listResult = await client.Files.ListFolderAsync(string.Empty); // handle the response, implement ListFolderContinueAsync, and so on
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,928 PostsLatest Activity: 15 hours ago
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 or Facebook.
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!