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

Forum Discussion

9 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    The Dropbox API doesn't offer the ability to download entire folders like this, but I'll be sure to pass this along as a feature request. (The Dropbox web site uses a different, internal interface for this.)
  • jjsk's avatar
    jjsk
    Helpful | Level 5
    8 years ago

    I think this would be nice resource saving feature.  I've seen all kinds of recursive download scripts that basically inundate the dropbox API with requests for each individual file.  Seems rather inefficient.   Thanks.

  • deFreitas's avatar
    deFreitas
    New member | Level 2
    8 years ago

    Here is a workaround, you can create a sharedlink for that folder

     

    curl -X POST https://api.dropboxapi.com/2/sharing/share_folder \
    --header "Authorization: Bearer $TK" \
    --header "Content-Type: application/json" \
    --data '{"path": "/legacy/teste-curl","acl_update_policy": "editors","force_async": true,"member_policy": "anyone"}'

     

    then download it using the preview_url

     

     

    wget -v https://www.dropbox.com/sh/{shared_link_id}?dl=1

     

     

    Like this example

     

     

    wget -v https://www.dropbox.com/sh/j1msw4e8dup2c5q/AAANYUWXcyBDgxVGkveU7AFla?dl=1

     

     

    After all you can unshare this folder for security reasons

     

     

    curl -X POST https://api.dropboxapi.com/2/sharing/unshare_folder \
    --header "Authorization: Bearer $TK" \
    --header "Content-Type: application/json" \
    --data "{\"shared_folder_id\": \"1896934208\",\"leave_a_copy\": false}"

     

  • jjsk's avatar
    jjsk
    Helpful | Level 5
    8 years ago


    This is nice thanks. I was also trying to decipher the download call through web client but it got a bit hairy.   The zip file comes from 

    https://dl-web.dropbox.com/zip_batch?_subject_uid=<dropbox id>

      but I could not figure out in developers tools panel what all the POST parameters were.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    The zip_batch endpoint isn't part of the public API, so I can't offer information on it or recommend trying to use it, as it is subject to change without warning.
  • jjsk's avatar
    jjsk
    Helpful | Level 5
    7 years ago

    Hi Greg

     

    This is good news. thanks for the update to the API.

  • jjsk's avatar
    jjsk
    Helpful | Level 5
    7 years ago

    I just tried this API call and it worked great.

     

    the only hiccup is an error when trying to d/l the root folder

     

    "Dropbox-API-Arg": path: The root folder is unsupported

     

    some files are saved in the application's root folder and the method seems to fail to get them zipped up

     

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

    That's the expected behavior. Downloading the root folder is not supported unfortunately, but I'll pass this along as a feature request. 

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!