Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
While building an integration with Dropbox I am running into typical situation of deleting folders at my app's end when a subject folder is deleted by the user on Dropbox. Via webhooks I am getting Metadata object actually DeleteMetadata object which does have path but no id, at my end we don't keep track of paths as such we were expecting the id within DeleteMetadata so as we can take action accordingly at our end.
Any recommendations?
Hello @user44,
You are correct that the /2/files/list_revisions endpoint will only work for files.
There isn’t a way to retrieve the deleted folder's id with the Dropbox API. If you have the previous FolderMetadata, you can align it based on the path from the DeletedMetadata.
Unfortunately, the Dropbox API doesn't return the file/folder ID for the DeletedMetadata, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
To retrieve the history of a deleted file, you can call the /2/files/list_revisions endpoint with the path from the DeletedMetadata. This will provide the file ID(s). Alternatively, you can store the path and ID for each last (File|Folder)Metadata you retrieved so that when you get a DeletedMetadata, you can check what the last known file ID was for that path.
Thanks for replying, the call /2/files/list_revisions is only for files I guess, and not for the folders.
I am using Dropbox's Java SDK and I am getting this erxception thrown while reaching it with a path to a folder instead of file : com.dropbox.core.v2.files.ListRevisionsErrorException: Exception in 2/files/list_revisions: {".tag":"path","path":"not_file"}
So, looks like the bottom line is, there is no way to get deleted folder's id, and we have to align the webhook notification with our system with path only.
Hello @user44,
You are correct that the /2/files/list_revisions endpoint will only work for files.
There isn’t a way to retrieve the deleted folder's id with the Dropbox API. If you have the previous FolderMetadata, you can align it based on the path from the DeletedMetadata.
Thanks!
Hi there!
If you need more help you can view your support options (expected response time for a 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!