Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The content you are looking for has been archived. View related content below.
Hi all,
Python 3.6, using module dropbox.
I have a URL for a file shared from someone else's dropbox account. The file gets regularly updated (same name, same link). I wish to download from this link.
I can't seem to get at it. I have code that looks like:
import dropbox
access_token = 'ABC123yNOBAAAAAAAAAYq3fOaDy6C4Lj7QV9dckXDqkQfGM2LW2Oe9hI2LXSPyTj'
dbx = dropbox.Dropbox(access_token)
url1 = 'https://www.dropbox.com/l/scl/ABC123NXsA-8ndaH0aOaaSBR5AH78NMHPTw'
but I can't work out which endpoint to call.
Cheers,
---=L
If you have a standard Dropbox shared link, you can use the 'sharing_get_shared_link_file' method to download the file:
Note, however, that the kind of link you posted here, with "/l/scl", is not a standard Dropbox shared link, but rather is a link intended only for manual use (e.g., sent via email). I'll send this along as a feature request to support this kind of link on the API though.
If you can follow the redirect on that link can get to a standard shared link however, with "/s/", you should be able to use the above method to download the data.
Hi Greg,
Thanks for the reply.
Now. this "/s/" type link. If I open the URL above, and log onto my Dropbox account, I end up at a URL that looks like:
https://www.dropbox.com/scl/fi/abc123lwaazd7qw1782a8/filename.mdb?dl=0&oref=e&r=ABc1239UH...
The page itself says ".mdb files can't pe previewed" (it's an Access file), and has a Download button with a Down triangle. Clicking on the button, my options are "Direct download" and "Save to my Dropbox". Can't see that ".../s/..." link anywhere.
Looking in the source code, quite late in the code I can see a json definition which looks like:
"file": {
"direct_blockserver_link": null,
"revision_id": "0123456780000010bed0280",
"preview": null,
"ts": 1548041627,
"sort_key": ["ABCdefRQCEIwLAEOAQ4A"],
"bytes": 47958016,
"preview_url": null,
"beacon_context": "ABC123I2BK93MmN3DY_YRsVuhGpnI9IrhK0",
"filename": "filename.mdb",
"sjid": 48,
"open_in_app_data": null,
"thumbnail_url_tmpl": null,
"href": "https://www.dropbox.com/scl/fi/abc123lwaazd7qw1782a8/filename.mdb?dl=0",
"file_id": "id:FFpFQXeecgAAAAAAAAAADQ",
"is_symlink": false,
"is_dir": false,
"preview_type": null,
"preview_thumbnail_url": null,
"ns_id": 1234569344,
"icon": "page_white_32"
},
I cannot however see anything like a "https://www.dropbox.com/s/...". Nothing with "/s/" in it anywhere in the source. That "href" URL looks promising (and it's what's in the bowser url along with some other stuff) , so I'll try that for now, but if I'm totally barking up the wrong tree looking for the "good" url, let me know.
Thanks for your help here. Have been banging my head against this wall since December.
Regards,
---=L
Okay. No go on that link.
File "/usr/local/lib/python3.6/site-packages/dropbox/base.py", line 3350, in sharing_get_shared_link_file
None,
File "/usr/local/lib/python3.6/site-packages/dropbox/dropbox.py", line 274, in request
timeout=timeout)
File "/usr/local/lib/python3.6/site-packages/dropbox/dropbox.py", line 365, in request_json_string_with_retry
timeout=timeout)
File "/usr/local/lib/python3.6/site-packages/dropbox/dropbox.py", line 454, in request_json_string
raise InternalServerError(request_id, r.status_code, r.text)
dropbox.exceptions.InternalServerError: InternalServerError('64c2c45dfd812b3bbbc893c67e834378', 503, '')
Thanks for checking that and providing the additional information. As you found, the type of sharing you're using uses "/scl/fi/" link, as opposed to the standard "/s/". (The latter is what you get from the API itself, such as from sharing_create_shared_link_with_settings for a file, or when copying a shared link for a file manually.)
Unfortunately, the "/scl/fi/" kind of link isn't supported for downloading from the API, but I'll pass this along as a feature request. Apologies I don't have better news for you!
Downloading this kind of link via sharing_get_shared_link_file should work now. Please try again and let me know if you're still seeing any issues.
Hi there!
If you need more help you can view your support options (expected response time for a 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!