One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
jasmine_r
7 years agoHelpful | Level 6
Dropbox API v2 to find whether the files are synced, deleted, renamed, moved or copied.
Dropbox API v2 in java provides methods to upload a file, read content of a file, etc. But is there a way to find that a file is either synced, deleted, renamed, moved or copied using these API's ?
- Greg-DB
Dropbox Staff
[Cross-linking for reference: https://stackoverflow.com/questions/50758392/dropbox-api-v2-to-find-the-files-that-are-synced-moved-renamed-copied-and-del ]
Using the Dropbox API v2 Java SDK, to keep track of file additions, edits, deletions, moves/renames, and copies, you should use listFolder and listFolderContinue. Please refer to the linked documentation for more information on how to use these methods. You can use continue to call listFolderContinue over time as necessary, using the last received cursor, to get just the changes that occurred since the last time you called.
Also, note that moves/renames will look identical, and will appear as a deletion at the old path and an addition at the new path. You can keep track of these using the file ID though, which won't change. Copies will look like new additions.
- jasmine_rHelpful | Level 6
Hi, Can you please explain how file ID can be used to keep track of these changes, because when a file is deleted the file ID is not available in the Deletedmetadata. I get only these attributes for a deleted file.
{ ".tag":"deleted", "name":"javacompile.txt", "path_lower":"/first/hai/javacompile.txt", "path_display":"/first/hai/javacompile.txt" }
If a file is renamed it is actually under deleted files and also renamed in the same path. To find if the file is renamed i tried correlating the path of the deleted file and renamed file, but to be accurate i need file ID for correlating renamed events. How do i get the file ID of deleted files ?
- Greg-DB
Dropbox Staff
The file ID isn't included in DeletedMetadata, so you should make sure to store the previous metadata, and check the file ID of the file that was previously at that path specified by the DeletedMetadata.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,949 PostsLatest Activity: 2 hours ago
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!