Lechucico
Lechucico

Reputation: 2102

Dropbox unique file ID

I store the files of dropbox into my app using the ((FileMetadata) entry).getId();

The main problem is when I receive a webhook with a DeleteMetadata it doesn't have the method getId, so I don't know what file is deleted. I have to store the path instead of the id?

By the other hand, when I use client.files().download(path) this method requires a path. Can I use the unique Id obtained using ((FileMetadata) entry).getId() to download a file?

Upvotes: 1

Views: 394

Answers (1)

Greg
Greg

Reputation: 16930

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

That being the case, if you need to the ID for the deleted file, you'll need to record and retrieve it based on the file you last saw at that path, before the deletion.

And yes, the download method does support file IDs in the path parameter.

Upvotes: 2

Related Questions