I am currently using the Dropbox API to get details about files. So I need show the user the file version number. However, the rev
item will return a file version which is like "35c1f029684fe". This is not consistent with the Dropbox UI which shows Version 1 or Version 0. How can I get this version number?
How to get the revision of an item with Dropbox API
1.2k views Asked by Alvin At
2
There are 2 answers
0
On
Just to help people like me that Googled it and fell here. Dropbox has a new version of the API (v2) for a couple of years now. The new endpoint for versions is: https://api.dropboxapi.com/2/files/list_revisions
In the body of the request you specify the path and the limit.
The lifetime for revisions today is 30 days for Plus accounts and 180 days for Professional and Business accounts.
Having browsed through their file/folder metadata, I don't see any field that gives the number you want. Instead, you can use the revisions API.
https://api.dropbox.com/1/revisions/<root>/<path>
This returns something like:
Note the revision numbers. There are a couple of caveats, though; some relevant snippets from the docs (emphasis mine):
It seems like the default parameters will return you the most recent revisions first. You can verify if this is the case; if so, it should meet your needs nicely.