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
Ashley B.15
9 years agoHelpful | Level 7
https://api.dropboxapi.com/2/sharing/list_folders should return all folders user can access?
Hi,
I've been looking at the below endpoint, forgive me if this is a silly question. Should this return all folders I can access in the dropbox ui?
https://api.dropboxapi.com/2/sharing/list_folders
I'm making a request to a users Dropbox using this header Dropbox-API-Select-User with the user id. This works with out any problems when I'm listing users files and folders.
When I do the following with sharing/list_folders it does not appear to bring all the folders. For example say I'm doing Dropbox-API-Select-User say on User 1.
User 2 has created a folder called "FOLDER" and shared this folder with User 1 and another, User 3.
"FOLDER" has a sub folder called "SUB FOLDER" which was created by User 3.
I can view these folders and upload to "SUB FOLDER" I've not set any limits for the request and there are only a few folders and files.
Am I missing something?
- Ashley B.15Helpful | Level 7
Just to confirm.when making a request with Dropbox-API-Select-User, it does not appear to list all the folders that user can access
- Greg-DBDropbox Staff
Hi Ashley, the /sharing/list_folders[/continue] endpoints should list all of the shared folders the specified user has access to. In your example, is "FOLDER" missing, or is it only "SUB FOLDER" that you're expecting and not seeing?
The endpoint wouldn't list the subfolders (e.g., "SUB FOLDER") or other contents of those shared folders, in case that's what you mean (since the subfolders aren't themselves shared folders, but are just in shared folders). You'd have to then call /files/list_folder[/continue] for each shared folder you want, if so.
Also, make sure you always check for a cursor in the response. If there is one, it indicates that there are more shared folders to return, and you should call /sharing/list_folders/continue to get them.
In any case, if you're still seeing issues with this, please share some sample code and output to help illustrate it.
- InderjeetdevHelpful | Level 5
As mentioned in https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_folders , API: https://api.dropboxapi.com/2/sharing/list_folders should return cursor variable, so that I can use it in https://api.dropboxapi.com/2/sharing/list_folders/continue API to get sub-folders, however https://api.dropboxapi.com/2/sharing/list_folders is not returning cursor variable in response. How do I get get cursor variable?
- Greg-DBDropbox Staff
Inderjeetdev The cursor field will be "Present if there are additional shared folders that have not been returned yet.". If the cursor is not returned, that means that there are no more shared folders to return, and so it is not necessary to call /2/sharing/list_folders/continue.
Also, note that the /2/sharing/list_folders[/continue] endpoints only return shared folders themselves, not the contents of shared folders. To list all of the contents of any particular folder, you would use /2/files/list_folder[/continue] instead.
- Ashley B.15Helpful | Level 7
Hi.
I'm expecting to see the "SUB FOLDER" in the endpoint as I can access/upload through the API. I did notice that "SUB FOLDER" had no "SharedFolderId" but a "ParentSharedFolderId" this would make sense. As you say its not a shared folder but in a shared folder. I think the description for this endpoint might be a bit misleading?
This is a shared folder which inherits its permissions from its parent? I would expect to see it in the endpoint
Thanks
- Greg-DBDropbox Staff
I see, thanks for clarifying. The /sharing/list_folders endpoint isn't supposed to list "SUB FOLDER" in that case, as that is just a normal folder inside a shared folder, and not a shared folder itself.
You can use /files/list_folder[/continue] to list the contents of "FOLDER".
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf 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!