cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We've been busy working on some major updates to the Community, so check out what's changing, what’s staying the same and what you can expect from the Dropbox Community 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: 

Access free folders and files with Dropbox.Api 4.9.4 in .Net

Access free folders and files with Dropbox.Api 4.9.4 in .Net

Sorliden
New member | Level 2

Hi!

I have been provided with a Dropbox URL (https://www.dropbox.com/sh/<code1>/<code2>) where I can access folders and download zip files in my web browser without providing any credentials.

How do I use the Dropbox.Api 4.9.4 in .Net to do the same thing?
* List content
* Navigate to sub folders
* Download files

What are code1 and code2 in the "Dropbox.Api terminology"?

I have tried to 

Best regards
  Sorliden

 

 

3 Replies 3

Greg-DB
Dropbox Staff

The Dropbox API doesn't offer exactly the same interface as the shared link web site itself, but here's what is available:

  • to list the contents of a shared link for a folder: ListFolderAsync with the 'sharedLink parameter'
  • to list the contents of a nested folder of a shared link for a folder: ListFolderAsync with the 'sharedLink' and 'path' parameters
  • to download a file from a shared link for a file: GetSharedLinkFileAsync with the 'url' parameter
  • to download a file from inside a shared link for a folder: GetSharedLinkFileAsync with the 'url' and 'path' parameters

Note though that these methods currently only support "user authentication", so they can't be used anonymously like the web site can. You'll need to supply an access token.

Also, when supplying the shared link a 'sharedLink' or 'url' parameter, you should just provide the entire link. There isn't any need to deconstruct these links and use the individual path components ('code1 and code2' in your example).

Sorliden
New member | Level 2

Thanks for the fast answer!

I guess I have to convince my information provider to lock the information and require credentials. Feels a little bit odd.

Or can you recommend any other solution of this problem? 
Dropbox.Api 4.9.4 seems to be the Dropbox API that is most alive (on https://www.nuget.org/) but it is not a requirment for me. But .Net is a requirment. 

Or can you implement an anonymous access token, fast? 😉

Best regards
  Sorliden

Greg-DB
Dropbox Staff

Using the API as I described above would offer you the most control over the integration, but one other solution would be to download from the link directly, without using the API. There's information here on how you can modify these shared links for direct access. You can then programmatically download from the modified link, using an HTTPS GET request, following redirects, with the HTTPS client of your choise. For shared links for folders, that would result in a zip download of the entire folder. You could then unzip that locally and use the contents as desired.

I'll also pass this along as a feature request for an anonymous way to do this on the API, but I can't promise if/when that would be implemented.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Sorliden New member | Level 2
What do Dropbox user levels mean?