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: 

API V2 Modified date for specific revision of a file in Python

API V2 Modified date for specific revision of a file in Python

dega
Explorer | Level 4
Go to solution

Hi,

I am trying to get the metadata for a specific revision of a file, 

with V1 I used to do:

 

metadata = client.metadata(FileName, list=False, file_limit=1, hash=None, rev=revN, include_deleted=False)
 

 then I had it in "metadata['modified']".

 

 

Now I can only see how to download a particular revision or get the metadata for the last N (up to 100) revisions of a file. What if I have more than 100 versions?

 

P.S.

How I can specify the revision in the path, as the SDK states for "file_download"?

 

files_download(path, rev=None)

Download a file from a user’s Dropbox.

Parameters    • path (str) – The path of the file to download.

                        • rev (Nullable) – Deprecated. Please specify revision in path instead. 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

In this example, you would call like this:

 

dbx.files_download('rev:2bc3d561afc23')

You don't need to specify the file path itself. You just need the "rev:abc123" format. The rev string actually identifies the file without the use of the path.

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

API v2 only supports listing up to 100 revisions, but I'll pass this along as a feature request for more.

To specify a particular revision in the `path` parameter, you should use a string like "rev:abc123" where abc123 is the rev string for the revision you want.

dega
Explorer | Level 4
Go to solution

Hi Greg, yes being able to go back more than 100 revision I believe will be something very nice to have.

 

Regarding the files_download, passing the revision inside the path, I tried this (and lots of different combinations):

dbx.files_download(FileName + "?rev:u'2bc3d561afc23'")

but it gives me an error, however 

dbx.files_download(FileName)

retrieves the latest file (as expected).

Moreover

 dbx.files_download(FileName,u'2bc3d561afc23')

retrieves the version I was looking for, so the revision string is correct.

 

Am I missing something?

I am tring to follow the guide not to implement something that will soon be deprecated.

 

Thanks,
Marco

Greg-DB
Dropbox Staff
Go to solution

In this example, you would call like this:

 

dbx.files_download('rev:2bc3d561afc23')

You don't need to specify the file path itself. You just need the "rev:abc123" format. The rev string actually identifies the file without the use of the path.

dega
Explorer | Level 4
Go to solution
aaaah! this was not so easy to understand from the guide (at least for me).
Thanks!!!
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    dega Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?