cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

Re: How to read a shared folder link in v2?

How to read a shared folder link in v2?

Vincent P.9
Explorer | Level 4

When I share a dropbox folder by passing a link to someone, the format is something like:

https://www.dropbox.com/sh/someid/someotherid?dl=0

Here is the API to read a shared folder:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_folder_metadata

What is the folder id? I tried every part of the shared link without any success, I just get a 409 error "Invalid id".

How can I read a shared link?

14 Replies 14

Greg-DB
Dropbox Staff

Alexander, it sounds like you already sorted some of this out, so I'll follow up on the latest thread you replied on, so as not to spam others on these threads.

gilbertwulff
Explorer | Level 3

Hey, is there an update on this already? I'm trying to get the shared folder id using the GetSharedLinkMetadataAsync method and its returning a way different id (ie:  id:3loy3mKeW5AAAAAAAAAACw) compared to the one expected in the MountFolderAsync method. 

 

Is there a way i can get the right folder id using an api from a shared folder link?

Greg-DB
Dropbox Staff

@gilbertwulff You opened a new thread for your question so I'll follow up there:

 

https://www.dropboxforum.com/t5/API-support/Why-are-the-ids-different/m-p/241094#M13418

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...:

carp21
Helpful | Level 6

Thank you Greg!

Need more support?