Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
denne
9 years agoExplorer | Level 3
General URL for many files from 1 shared folder
Hello community,
In my dropbox I have a folder with 200 country flags which I would like to download automatically using the respective URLs.
My problem is that the URL of every single file contains a key which is unique.
Example:
- for the USA flag the URL is https://dl.dropboxusercontent.com/s/rzateuez21i5c95/us.png?dl=0
- for the Gereat Britain flag the URL is https://dl.dropboxusercontent.com/s/2ct7i7ov5zf6r0z/gb.png?dl=0
Every URL consists of four parts: https://dl.dropboxusercontent.com s/XXXXXXXXXXXXX/ FILENAME.FILEFORMAT ?dl=0
So every shared file gets its own key s/XXXXXXXXXXXXX/ which is unique.
Is is it somehow possible to create a URL without this unique key part s/XXXXXXXXXXXXX/ ?
Something like this: https://dl.dropboxusercontent.com/us.png?dl=0
Thank you
- Dropbox API v2 now supports listing the contents of a shared link for a folder. This can be accomplished using the same interface as listing a folder in a connected user's account, via the list_folder functionality. To list the contents of a shared link for a folder, you instead provide the shared link URL in the `shared_link` parameter to list_folder:
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
You can also get the shared link metadata and file data using:
https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_metadata
https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file
If you're using an official SDK, there will also be corresponding methods for these endpoints.
So, you could use a shared link for a folder and then programmatically list and access the contents.
12 Replies
Replies have been turned off for this discussion
- Greg-DB6 years ago
Dropbox Community Moderator
duckladydinh No, unfortunately there currently isn't a way to download a whole sub-folder from a a shared link for a folder via the API, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Note that you can download the top-level folder as a zip from the shared link as documented here, but that doesn't provide a mechanism for downloading a specific sub-folder.
- Greg-DB5 years ago
Dropbox Community Moderator
Update: The Dropbox API now returns the shared link for the nested item as 'url' when requesting the metadata for that item using the "path" parameter on /2/sharing/get_shared_link_metadata (instead of the original parent link). You could use that to download a specific sub-folder.
About 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!