We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

Oliver C.'s avatar
Oliver C.
New member | Level 1
10 years ago

Does the 'rev' field in the metadata for a file change if the file is moved or renamed?

I'm using the Webhooks API (and the core API) in my application. I need to determine if a file has been deleted from Dropbox or just renamed/moved. The /delta endpoint will only tell you when a path has been deleted/moved/renamed (no metadata), and then provide another entry if the path is new/moved/renamed (with new metadata)  After some experimentation it looks like the 'rev' field stays constant for files when I move and/or rename them (at least using the Linux Dropbox client). I'm wondering if I can rely on this always being the case, or whether I should use some other method? Other suggestions I've seen are to download the file to get a hash for it (and then comparing that with a previously stored hash), or doing a similar thing using the 'client_mtime' and 'bytes' fields in the metadata, neither of which are ideal for different reasons (e.g. client_mtime probably can't always be relied upon).

1 Reply

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    You should not use the rev to track changes to files across moves/renames, and in fact the rev value is always expected to change when a file is moved or renamed. Be careful when comparing rev values by eye though, as subsequent values may differ only very subtly, e.g., by changing a single character slightly.

    Anyway, API v1 unfortunately doesn't have a good way to track moves/renames like this. The other techniques one might try are not ideal, as you mentioned.

    API v2 will, e.g., by offering IDs for files, but that's currently just a preview.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,037 PostsLatest Activity: 2 hours ago
412 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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!