You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

elsigh's avatar
elsigh
Helpful | Level 5
5 years ago

Cannot call filesDownload for entries in a sharedLink to a folder (get path_not_found)

 

My use case is that I have a sharedLink to a folder where I'm not the owner and I'd like to build a little viewer for the contents of the that folder. I can get the list of files in a folder but not their contents. I believe I could accomplish this with a scraper, so it'd be nicer to do this in the API (and even without an access token at all since it's publicly accessible)

 

The URL to the sharedLink folder is: https://www.dropbox.com/sh/1dj7xiu7s0kgqoo/AADQjza7GmZlOFZk9pk0KHVda?dl=0 

I can open that incognito and see the files and download their contents in a browser.

 

REPRO - You can repro this as the not-folder-owner (aka anyone can repro this)

 

1) In the Dropbox API explorer get an access token

 

2) Call sharingGetSharedLinkMetdata with a sharedLink URL

https://dropbox.github.io/dropbox-api-v2-explorer/#sharing_get_shared_link_metadata

Set url: https://www.dropbox.com/sh/1dj7xiu7s0kgqoo/AADQjza7GmZlOFZk9pk0KHVda?dl=0 

 

3) Returns a folder with id id:zY8_f7IMoCgAAAAAAAIRmw

 

4) Call filesListFolder with that sharedLink url

https://dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder

Open the shared_link (optional) disclosure thing and paste in the url:

https://www.dropbox.com/sh/1dj7xiu7s0kgqoo/AADQjza7GmZlOFZk9pk0KHVda?dl=0

 

That returns a response with a entries ala:

{
  "entries": [
    {
      ".tag": "file",
      "name": "Papa Smurf.pro",
      "parent_shared_folder_id": "37786917",
      "id": "id:zY8_f7IMoCgAAAAAAAIRnQ",
      "client_modified": "2020-04-28T14:20:44Z",
      "server_modified": "2020-04-28T14:20:45Z",
      "rev": "5a45a8994a4ed02409525",
      "size": 94,
      "sharing_info": {
        "read_only": true,
        "parent_shared_folder_id": "37786917",
        "modified_by": "dbid:AAC7xJh2VcDvncsSSMKnV9xJNEFqtltu0i4"
      },
      "is_downloadable": true,
      "content_hash": "ddb599aaa5b2783c61da68e567979f62a36559fc1d46a2bdfc2641a055c3b1ad"
    },
    {
      ".tag": "file",
      "name": "Papa Smurf 2.pro",
      "parent_shared_folder_id": "37786917",
      "id": "id:zY8_f7IMoCgAAAAAAAIRnw",
      "client_modified": "2020-04-28T15:54:59Z",
      "server_modified": "2020-04-28T15:55:01Z",
      "rev": "5a45bdaae036402409525",
      "size": 86,
      "sharing_info": {
        "read_only": true,
        "parent_shared_folder_id": "37786917",
        "modified_by": "dbid:AAC7xJh2VcDvncsSSMKnV9xJNEFqtltu0i4"
      },
      "is_downloadable": true,
      "content_hash": "c4aaf32c5eb77ec622cc44797a206cb5cd8cee02216cd98773f4deb5dddfc138"
    }
  ],
  "cursor": "AAGH_lfzMqN8k2xRWEYojPGQIrsbS-653JiMpm_NsFP-bxdQ6XD34Yl79XSWXtLt6Olds7I7ByFNlcqsSj3aXzr2aDmqCWiKy0D7-BALOObMMmHWwrKMKZ5No7E2bRnzTG9qF-t5dGRIaB4mr5aCyFg-aq5M2Zm08s5DRmBDPnoK_31ckeEoe-V6U1BCiuhGMEa664tTyJbJsJU_p3szks0i2iRdTPgS75TsEcXWpEuL9IosLEx9RIwss1aK5zVEnJKJOJhujgtMY_sQXh4SYkWM48-KKvgHO-d53XEV5Saxu7FgPj--AyJGPxMUGd764yA",
  "has_more": false
}

 

5) Try to download one of those files

https://dropbox.github.io/dropbox-api-v2-explorer/#files_download

paste any of those entries ids from above (ala id:zY8_f7IMoCgAAAAAAAIRnQ) 

 

{
  "error_summary": "path/not_found/...",
  "error": {
    ".tag": "path",
    "path": {
      ".tag": "not_found"
    }
  }
}

cc Greg-DB 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The /2/files/download endpoint only supports downloading files in the connected account, so this error is expected in this case.

     

    For this use case, you'd instead need to use /2/sharing/get_shared_link_file (sharingGetSharedLinkFile).

     

    Both of those only support "user authentication" though, so an access token is necessary. I'll pass this along as a feature request for support for calling without an access token, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

     

    Another option would be to download from the shared link itself using the "dl" parameter documented here, but that doesn't offer a way to specify an get only a particular file from the linked folder. 

     

    Also, I should note that scraping the Dropbox web site is prohibited by the terms, and subject to break without warning anyway.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 3 hours ago
333 Following

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 or Facebook.

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!