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
loop1213123
5 years agoExplorer | Level 3
Understanding how the metadata API works and updates files
Hi, I'm developing a desktop application that allows users to view and add file metadata. The metadata is stored separately from the files themselves. I'd like to integrate this with Dropbox, and I figured that Dropbox's metadata API was a logical thing to use. In order for the application to work efficiently, it'll need to keep a cache of metadata on the client machine. What I'm not clear on his how Dropbox will update a client when there's change to the Dropbox's server-side metadata.
In other words, imagine there are two synced client machines, each with an up-to-date cache of file metadata. Suppose client 1 updates a particular file's metadata, so a change is made to both client 1's cache and using the HTTP Dropbox API. Client 1 is now up-to-date. Will anything happen on client 2's machine through Dropbox? I know that if the content of the file had changed, a file update would be somehow pushed to client 2. But does the metadata change do anything like that? If not, can the API be used to force a change to client 2? I don't think client 2 can use a webhook, because it's not a server, right?
As you can probably tell, I'm very new to this. So thank you very much for any information or guidance.
For reference, note that there are two different "metadata" concepts to be aware of when using Dropbox and the Dropbox API:
- The standard metadata used by Dropbox, e.g., as returned as the "Metadata" types on the Dropbox API, such as via /2/files/get_metadata. Third party apps can't set arbitrary/custom fields in this though.
- The custom metadata that API apps can set and store on Dropbox via the Dropbox API, using the 'file_properties' endpoints.
Also, to be clear with the terminology, there are two different types of "clients" that may be relevant here:
- The official Dropbox desktop client, which automatically syncs files in the connected Dropbox account to the local filesystem.
- Your third party desktop app, which you can write to perform whatever operations you wish via the Dropbox API.
When a file changes, the official Dropbox desktop client will update its local copy of the file to the latest version. The official Dropbox desktop client does not sync custom metadata from the 'file_properties' endpoints though.
And you're correct that webhooks wouldn't work with your third party desktop app, as webhooks are designed to be used by servers.
For client-side apps like this, you would instead use the /2/files/list_folder/longpoll functionality to get low-latency notification of changes to files. That unfortunately won't notify you of changes just to the 'file_properties' custom metadata though. I'll pass this along as a feature request, but I can't promise if or when that might be implemented though.
You'd instead need to poll /2/files/list_folder[/continue] or /2/files/get_metadata as needed to check for changes to the 'file_properties' custom metadata.
- Greg-DBDropbox Staff
For reference, note that there are two different "metadata" concepts to be aware of when using Dropbox and the Dropbox API:
- The standard metadata used by Dropbox, e.g., as returned as the "Metadata" types on the Dropbox API, such as via /2/files/get_metadata. Third party apps can't set arbitrary/custom fields in this though.
- The custom metadata that API apps can set and store on Dropbox via the Dropbox API, using the 'file_properties' endpoints.
Also, to be clear with the terminology, there are two different types of "clients" that may be relevant here:
- The official Dropbox desktop client, which automatically syncs files in the connected Dropbox account to the local filesystem.
- Your third party desktop app, which you can write to perform whatever operations you wish via the Dropbox API.
When a file changes, the official Dropbox desktop client will update its local copy of the file to the latest version. The official Dropbox desktop client does not sync custom metadata from the 'file_properties' endpoints though.
And you're correct that webhooks wouldn't work with your third party desktop app, as webhooks are designed to be used by servers.
For client-side apps like this, you would instead use the /2/files/list_folder/longpoll functionality to get low-latency notification of changes to files. That unfortunately won't notify you of changes just to the 'file_properties' custom metadata though. I'll pass this along as a feature request, but I can't promise if or when that might be implemented though.
You'd instead need to poll /2/files/list_folder[/continue] or /2/files/get_metadata as needed to check for changes to the 'file_properties' custom metadata.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 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!