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's avatar
Ashley B.15
Helpful | Level 7
9 years ago

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.15's avatar
    Ashley B.15
    Helpful | 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-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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.

     

  • Ashley B.15's avatar
    Ashley B.15
    Helpful | 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-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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".