cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 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

Greg-DB
Dropbox Staff

[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.)

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.

Greg-DB
Dropbox Staff

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.

Greg-DB
Dropbox Staff

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

James Z.3
New member | Level 1

Thanks Greg!

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.

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.

Need more support?