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
janhec
4 years agoHelpful | Level 6
Easiest way to get (dropbox) file datetime using a dropbox link
Hi All,
I share a project I'm working on through some executables on dropbox, which users get a link to, so they can download.
I prefer, obviously, that they have an account, so they will have au...
- 4 years ago
Using the /2/sharing/get_shared_link_metadata endpoint is the right way to get metadata from a shared link, but that does require an access token, as you found.
There isn't another way to get the modified time of the file from the shared link directly, but you could instead use that "etag" value returned with that 200 response when accessing the shared link. You can store the etag for the version of the file you last downloaded, and before downloading it again, check the current etag value. If the etag value hasn't changed, that means that the content hasn't changed.
Greg-DB
4 years agoDropbox Staff
Using the /2/sharing/get_shared_link_metadata endpoint is the right way to get metadata from a shared link, but that does require an access token, as you found.
There isn't another way to get the modified time of the file from the shared link directly, but you could instead use that "etag" value returned with that 200 response when accessing the shared link. You can store the etag for the version of the file you last downloaded, and before downloading it again, check the current etag value. If the etag value hasn't changed, that means that the content hasn't changed.
- janhec4 years agoHelpful | Level 6
Greg-DB ,
Thank you.
That is quite helpful and probably sufficient. I'll tag it as a solution.
But it still surprises me that the last modified date is not given, and also not shown in de preview/download page you get when clicking the ....?dl=0 link. I really think that it would be helpful for people to avoid downloading a file which is identical to a previously downloaded file. I would really hope that dropbox does not deem this sort of functionalitty to be reserved to account-holders only.
Thanks again,
Jan
- janhec2 years agoHelpful | Level 6
Re: The identical code now yields no useful information (with regard to fileversion).
Etag has disappeared, X-Dropbox-Request-Id changes per request.So I'll ask, instead of ranting about lack of backward compatibility, what is the way to
check a shared linked file for new version without downloading it (and even then...).
Here's what I get now, since a few days and after unreliable/varying responses:
--------------------------
HTTP/1.1 200 OK
Content-Security-Policy: font-src https://* data: ; style-src https://* 'unsafe-inline' 'unsafe-eval' ; base-uri 'self' ; default-src https://www.dropbox.com/playlist/ https://www.dropbox.com/v/s/playlist/ https://*.dropboxusercontent.com/p/hls_master_playlist/ https://*.dropboxusercontent.com/p/hls_playlist/ ; frame-src https://* carousel: dbapi-6: dbapi-7: dbapi-8: dropbox-client: itms-apps: itms-appss: ; child-src https://www.dropbox.com/static/serviceworker/ blob: ; media-src https://* blob: ; connect-src https://* ws://127.0.0.1:*/ws ; report-uri https://www.dropbox.com/csp_log?policy_name=metaserver-whitelist ; form-action 'self' https://www.dropbox.com/ https://dl-web.dropbox.com/ https://photos.dropbox.com/ https://paper.dropbox.com/ https://showcase.dropbox.com/ https://www.hellofax.com/ https://app.hellofax.com/ https://www.hellosign.com/ https://app.hellosign.com/ https://docsend.com/ https://www.docsend.com/ https://help.dropbox.com/ https://navi.dropbox.jp/ https://a.sprig.com/ https://selfguidedlearning.dropboxbusiness.com/ https://instructorledlearning.dropboxbusiness.com/ https://sales.dropboxbusiness.com/ https://accounts.google.com/ https://api.login.yahoo.com/ https://login.yahoo.com/ https://experience.dropbox.com/ https://pal-test.adyen.com https://2e83413d8036243b-Dropbox-pal-live.adyenpayments.com/ ; img-src https://* data: blob: ; object-src 'self' https://cfl.dropboxstatic.com/static/ https://www.dropboxstatic.com/static/ ; worker-src https://www.dropbox.com/static/serviceworker/ blob: ; frame-ancestors 'self' ; script-src 'unsafe-eval' https://www.dropbox.com/static/api/ https://www.dropbox.com/page_success/ https://cfl.dropboxstatic.com/static/ https://www.dropboxstatic.com/static/ https://accounts.google.com/gsi/client https://canny.io/sdk.js https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ 'unsafe-inline'
Content-Type: text/html; charset=utf-8
Pragma: no-cache
Referrer-Policy: strict-origin-when-cross-origin
Set-Cookie: gvc=NDA2MzQyMTE4OTgyOTM1NjUzMDg0NTY5MTk5MzEzNDEwMzgyNjQ=; Path=/; Expires=Mon, 15 May 2028 19:09:07 GMT; HttpOnly; Secure; SameSite=None
Set-Cookie: t=GwpLm07-vGJT-M6RXpRnzwJ8; Path=/; Domain=dropbox.com; Expires=Sat, 16 May 2026 19:09:07 GMT; HttpOnly; Secure; SameSite=None
Set-Cookie: __Host-js_csrf=GwpLm07-vGJT-M6RXpRnzwJ8; Path=/; Expires=Sat, 16 May 2026 19:09:07 GMT; Secure; SameSite=None
Set-Cookie: __Host-ss=mY4WgzA-Fo; Path=/; Expires=Sat, 16 May 2026 19:09:07 GMT; HttpOnly; Secure; SameSite=Strict
Set-Cookie: locale=en; Path=/; Domain=dropbox.com; Expires=Mon, 15 May 2028 19:09:07 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow, noimageindex
X-Xss-Protection: 1; mode=block
Date: Wed, 17 May 2023 19:09:07 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
Server: envoy
Cache-Control: no-cache, no-store
Vary: Accept-Encoding
X-Dropbox-Response-Origin: far_remote
X-Dropbox-Request-Id: d5e15471969948c685be3ae620c37c34
Transfer-Encoding: chunked------------------------------
Anyone?
- Greg-DB2 years agoDropbox Staff
Using /2/sharing/get_shared_link_metadata is still the right way to get metadata from a shared link, and that now supports both User Authentication (using an access token, as before) as well as App Authentication (using an app key and secret instead of an access token). If that works better for your use case now, I suggest looking into that. You can get an app key and secret by registering an app here; be sure to use "Full Dropbox" access for this scenario (even though you won't need to actually connect it to an account and get an access token to call /2/sharing/get_shared_link_metadata with app authentication).
When calling /2/sharing/get_shared_link_metadata for a file, you can check the returned "rev" value, which is a revision identifier, in addition to "server_modified". Check out the documentation there for the full field information.
As for the etag value when accessing the shared link directly, that is still working and being returned with the etag for me when I try accessing a file directly using curl with a valid shared link to a file with "dl=1". I see in your output that you're getting back an HTML page. I recommend checking if the shared link you're using is still valid. You can manually try it in a web browser to see what that HTML page is; it may contain an error message regarding the shared link.
Also, the 'X-Dropbox-Request-Id' value is expected to change on every request, as that is an identifier for each request made to Dropbox, not the file being accessed itself.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,880 PostsLatest Activity: 10 hours agoIf 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!