cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We love to hear how every person gets the most from Dropbox, and it seems everyone has a slightly different use for it - tell us yours 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: 

restore files,but return error: invalid_revision with Picture modified a few months ago

restore files,but return error: invalid_revision with Picture modified a few months ago

Glority
Helpful | Level 5

Hi,

I am confused about the correct use of the restore api.

i find some pictures in my account which are upload just several days, delete it and restore,everything is ok!

but, if these pictures are upload several months ago, delete it and restore,i will get an error from server:invalid_revision,

if i go to "https://www.dropbox.com/" sign in and restore the pictures just deleted, and then retry to delete and restore using api rather than directly visit 'dropbox' site to restore,it's also ok!

is the way i use api wrong? But in most cases the restore api can be used successfully, or it could be..

please help me! thanks. Below is my part of code.

restore.png

8 Replies 8

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Greg-DB
Dropboxer

An "invalid_revision" error from /2/files/restore should mean "The revision is invalid. It may not exist or may point to a deleted file.". In this case, it sounds like it's because the file revision you're using when calling the API is for a version of the file from several months ago, which is no longer be available. 

 

File version retention length will vary by account type. For instance, Dropbox Basic accounts only store file versions for 30 days. You can find more information on that in the help center.

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Glority
Helpful | Level 5

Thank you for your reply!

Your reply has helped me a lot, but I still don’t understand: In the basic account, the files deleted one month ago are the same as the files deleted the files just now which upload one month ago ? All they can't restore, please let me know, thank you!

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Greg-DB
Dropboxer

I'm not sure I understand your latest message. Can you clarify? Alternatively, if you have questions about Dropbox file restorations and version history retention in general, you can contact support directly.

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Glority
Helpful | Level 5

Thank you for your reply!

In order to explain my situation more clearly, let’s take an example.

The timeline goes back to two months ago. ,I did two operations: 1. Delete file A in dropbox, 2. In dropbox File B is uploaded here.

Back to today, I already know that I cannot restore the deleted file A with basic account, but if I delete the file B now and try to restore it, it will not succeed. Please tell me, is this the phenomenon that it should be?

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Greg-DB
Dropboxer

Thanks, that's helpful. Yes, if file B was only recently deleted (less than 30 days ago) you should be able to restore it via the API with a basic account. Is that the particular case that is failing for you via the API? Can you double check you're using the correct recent revision ID? (That would be the "rev" variable in your code, but it doesn't show where/how you get that value.)

 

If so, please open an API ticket with the details so we can investigate this for you. Specifically, the following may be helpful:

  • the affected account ID
  • a sample file path that displayed the issue
  • the revision ID you specified to restore, and where you retrieved it from

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Glority
Helpful | Level 5

Thanks!Yes, That is the particular case that is failing for me via the API.I check my revision ID when delete and restore ,they have always been the same.

  The affected account id: <REDACTED>.

   the sample file maybe not important, because any file that meets the conditions can reproduce this problem.If you have any progress on this issue, please let me know.Thanks!

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Greg-DB
Dropboxer

Thanks, I see you opened a ticket, so we'll follow up with you there.

Re: restore files,but return error: invalid_revision with Picture modified a few months ago

Glority
Helpful | Level 5

Thank you and look forward to your reply!

Who's talking

Top contributors to this post

  • User avatar
    Glority Helpful | Level 5
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?