cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

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: 

Dropbox API v2 to find whether the files are synced, deleted, renamed, moved or copied.

Dropbox API v2 to find whether the files are synced, deleted, renamed, moved or copied.

jasmine_r
Helpful | Level 6

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 ?

3 Replies 3

Greg-DB
Dropbox Staff

[Cross-linking for reference: https://stackoverflow.com/questions/50758392/dropbox-api-v2-to-find-the-files-that-are-synced-moved-... ]

 

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_r
Helpful | 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.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    jasmine_r Helpful | Level 6
What do Dropbox user levels mean?