cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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: 

Getting download URLs from shared folders

Getting download URLs from shared folders

Björn S.1
New member | Level 1

My client has a partnership with a photographer who dumps images in a dropbox folder that is shared. It can be accessed through /sh/... link. For dropbox to work in our solution I need to be able to gather links to and download the images. I found the metadata/link API endpoint but that doesn't give me any possibilities to traverse folders or get urls to actual files? What use is the metadata/link endpoint if it's not possible to download a file using it?

I'm using a sampel app OAuth token to authenticate my requests.

7 Replies 7

Re: Getting download URLs from shared folders

Greg-DB
Dropboxer

[Edit to offer a simpler solution]

The /metadata/link endpoint allows the app to get additional metadata (path, size, etc.) as well as individual links to files within the folder the link points to. To do so, call /metadata/link with the shared link as the link parameter, as well as the desired sub-path as the path parameter. Then modify and use the returned link to download the contents directly:

https://www.dropbox.com/help/201

(You can use list=true first to get the listing of the folder first.)

Re: Getting download URLs from shared folders

James Z.3
New member | Level 1

Hi Gregory, is the metadata/link endpoint available in the Swift API? I can't seem to find it in the documentation or by looking through the source.

Re: Getting download URLs from shared folders

Greg-DB
Dropboxer

The Swift SDK uses API v2, which doesn't currently have an equivalent of /metadata/link. I believe it is planned, but I don't have a timeline to offer right now.

Re: Getting download URLs from shared folders

Greg-DB
Dropboxer

Dropbox API v2 now offers this via the endpoint /sharing/get_shared_link_metadata:

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

Re: Getting download URLs from shared folders

James Z.3
New member | Level 1

Thanks Greg!

Re: Getting download URLs from shared folders

Alexander P.5
New member | Level 1

Gregory, v1 does not have urls to download files. Tried with "public link" url, gives me entries like this:

rualpe-ws:seene-dropbox-experiments paf$ curl -s -d "client_id=$client_id&client_secret=$client_secret&link=https://www.dropbox.com/sh/02pygaow396w775/AAC8ycNc44-87K0To_xeEsLca?dl=0&list=true&path=/Sample Album"   -XPOST https://api.dropbox.com/1/metadata/link |jq .

...

    {

      "rev": "80b8dedbf",

      "thumb_exists": true,

      "path": "/Sample Album/Pensive Parakeet.jpg",

      "is_dir": false,

      "client_mtime": "Fri, 09 Nov 2012 14:32:58 +0000",

      "icon": "page_white_picture",

      "bytes": 480098,

      "modified": "Sun, 21 Apr 2013 13:44:16 +0000",

      "size": "468.8 KB",

      "root": "link",

      "mime_type": "image/jpeg"

    }

 

 

I'm after links to thumbnails and links to file previews.

Re: Getting download URLs from shared folders

Greg-DB
Dropboxer

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Alexander P.5 New member | Level 1
  • User avatar
    James Z.3 New member | Level 1
What do Dropbox user levels mean?
Need more support?