cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Understanding how the metadata API works and updates files

Highlighted

Understanding how the metadata API works and updates files

Explorer | Level 3

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.

1 Accepted Solution

Accepted Solutions
Highlighted

Re: Understanding how the metadata API works and updates files

Dropboxer

For reference, note that there are two different "metadata" concepts to be aware of when using Dropbox and the Dropbox API:

  1. 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.
  2. 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:

  1. The official Dropbox desktop client, which automatically syncs files in the connected Dropbox account to the local filesystem.
  2. 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.

 

View solution in original post

1 Reply 1
Highlighted

Re: Understanding how the metadata API works and updates files

Dropboxer

For reference, note that there are two different "metadata" concepts to be aware of when using Dropbox and the Dropbox API:

  1. 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.
  2. 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:

  1. The official Dropbox desktop client, which automatically syncs files in the connected Dropbox account to the local filesystem.
  2. 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.

 

View solution in original post

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?