Learn how to make the most out of the Dropbox Community here 💙. 

Forum Discussion

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    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

      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

        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}"