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: 

Get metadata of a deleted file

Get metadata of a deleted file

mudunuru
New member | Level 2
Go to solution

Below is the scenario we need to acheive. 

Whenever a file is deleted from the dropbox the same should be removed from our database as well.

In our database we are storing the id of the file rather than the path, so that the filename is renamed or file is moved we don't miss the file link and can download the file.

We implemented webhooks for getting the deleted files. In the entries of deleted files {.tag = 'deleted'}, we are not getting the meta data (id of the file). So we could not map the database record with the deleted entry from the dropbox which we received by webhook implementation.

We tried to use the meta data and file download api to get the ID of the file but since the file is not present in the path we are getting { ".tag": "not_found" } or 402 conflict message. How to get the file id for a deleted file?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API doesn't return the file/folder ID for DeletedMetadata, but I'll pass this along as a feature request.

You can call /2/files/list_revisions with the path from the DeletedMetadata to get the history of the file at that though, including the file ID(s).

Alternatively, you can store the path and id for the each last (File|Folder)Metadata you saw, so that when you get a DeletedMetadata, you can check what the last known file ID was for that path.

 

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API doesn't return the file/folder ID for DeletedMetadata, but I'll pass this along as a feature request.

You can call /2/files/list_revisions with the path from the DeletedMetadata to get the history of the file at that though, including the file ID(s).

Alternatively, you can store the path and id for the each last (File|Folder)Metadata you saw, so that when you get a DeletedMetadata, you can check what the last known file ID was for that path.

 

mudunuru
New member | Level 2
Go to solution

Hi Greg,

Thank you for quick turnaround. As you suggested storing the path in DB and using the same for doing the deletion should do since the file_id changes every time we change the revision, rename the file or move the file. 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    mudunuru New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?