We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
jdm2
5 years agoExplorer | Level 3
Determine if file has finished synchronising
I have a simple problem:
I store some data in DropBox which is shared between multiple people
Several times people have started editing the data bnefore it has finished synchronising
What I wa...
- 5 years ago
Dropbox doesn't offer an API for checking the status of the Dropbox desktop client like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Dropbox does offer an API, but it is for communicating directly with the Dropbox servers, regardless of the state of the local Dropbox desktop client (if any).
For this use case though, you could potentially implement some of this using code running on the local machine and talking to the Dropbox API. That is, for any particular file:
- read the locally available file data and compute its "content hash" as documented here
- call the Dropbox API /2/files/get_metadata endpoint for that file (or /2/files/list_folder[/continue] to list the contents of a folder) and get the relevant `content_hash` value
- compare the the local and remote content hash values: if they match, you know you have the same data locally and remote; if they don't match, the data differs.
There are still race conditions possible with such a process though. E.g., the desktop client could sync down the new version of a file right after you check the content hash of the old one and before you compare it with the remote one, etc.
By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints.
jdm2
Explorer | Level 3
As I said in my original request
I want a subroutine which I can call in my application which takes a filename as argument and returns a status to indicate ideally the following statuses:
- The file is in DropBox and is synchronised to the cloud
- The file is in DropBox but isn't yet synchronised to the cloud
- The DropBox Service isn't running
- The file isn't in DropBox
I've looked through the API and I cannot find anything which gives this, to me fairly fundamental, information. I'm very happy to write the code if it is in the API, I just need the information as to how to find the information I need.
I don't like command line or web scrapers or similar because they are maintenance nightmares. I also don't like unsupported mechanisms for the same reason.
Greg-DB
5 years agoDropbox Staff
Dropbox doesn't offer an API for checking the status of the Dropbox desktop client like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Dropbox does offer an API, but it is for communicating directly with the Dropbox servers, regardless of the state of the local Dropbox desktop client (if any).
For this use case though, you could potentially implement some of this using code running on the local machine and talking to the Dropbox API. That is, for any particular file:
- read the locally available file data and compute its "content hash" as documented here
- call the Dropbox API /2/files/get_metadata endpoint for that file (or /2/files/list_folder[/continue] to list the contents of a folder) and get the relevant `content_hash` value
- compare the the local and remote content hash values: if they match, you know you have the same data locally and remote; if they don't match, the data differs.
There are still race conditions possible with such a process though. E.g., the desktop client could sync down the new version of a file right after you check the content hash of the old one and before you compare it with the remote one, etc.
By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints.
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 7 days 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!