cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to list a shared directory via Dropbox API?

How to list a shared directory via Dropbox API?

rustyx2
Helpful | Level 5

I am writing an app that needs to download all the files from a directory shared via a link.

But when a link is a folder, /2/sharing/get_shared_link_file returns:

HTTP/409 shared_link_is_directory/..



So then I invoke /2/sharing/get_shared_link_metadata, I get:

{
  ".tag": "folder",
  . . .
}



There is just an indication of a folder, but no way to see the contents of it.

However, when I access the same URL via a browser, I do see the contents and I am able to download the files without "mounting" the shared folder into my Dropbox.

So it appears to be possible via a Browser, but not via the API.

Is there a list_shared_folder API or something like it?

 

11 Replies 11

Greg-DB
Dropbox Staff
We don't currently have a replacement for that functionality on API v2. If your app uses that, please open an API ticket here to request an extension for access to API v1:

https://www.dropbox.com/developers/contact

Greg-DB
Dropbox Staff
Dropbox API v2 now supports listing the contents of a shared link for a folder. This can be accomplished using the same interface as listing a folder in a connected user's account, via the list_folder functionality. To list the contents of a shared link for a folder, you instead provide the shared link URL in the `shared_link` parameter to list_folder:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder

If you're using an official SDK, there will also be a corresponding method for this endpoint:


In the .NET SDK that's available as `ListFolderAsync`:

https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFol...


In the Java SDK that's available via `listFolderBuilder` to get a `ListFolderBuilder` on which you can call `ListFolderBuilder.withSharedLink`:

https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesReq...

https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/ListFolderBuild...

https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/ListFolderBuild...


In the JavaScript SDK that's available as `filesListFolder`:

https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolder__anchor


In the Python SDK that's available as `files_list_folder`:

https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.files_lis...


In the Swift SDK that's available as `listFolder`:

https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:13SwiftyDropbox1...


In the Objective-C SDK that's available as `listFolder`:

https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:ob...:
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    dougnorton New member | Level 2
  • User avatar
    Stephen C.14 Dropbox Staff
  • User avatar
    rustyx2 Helpful | Level 5
What do Dropbox user levels mean?