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

jdm2's avatar
jdm2
Explorer | Level 3
6 years ago

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...
  • Greg-DB's avatar
    Greg-DB
    6 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. 

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API

Make connections with other developers

797 PostsLatest Activity: 2 days ago
199 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!