Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Björn S.1's avatar
Björn S.1
New member | Level 1
10 years ago

Getting download URLs from shared folders

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    [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's avatar
    James Z.3
    New member | Level 1
    10 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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.

  • Alexander P.5's avatar
    Alexander P.5
    New member | Level 1
    9 years ago

    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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!