Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
AmanSingh
5 years agoExplorer | Level 3
invalid_revision error while restoring file version through api
I am trying to restore file to an older versi on through API but it throws the error as shown in the picture. What can be best solution to use through API ? Hope for the quick reply. Th...
AmanSingh
4 years agoExplorer | Level 3
Hi,
Thanks for the response.
Using Dropbox Java SDK v4.0.1 for development. I am trying to restore deleted files using -
files().restore(path, rev)
But its throwing an error "invalid_revision".
I am getting path from metadata for deleted file in listFolder() with includeDeleted = true.
And I am getting rev from listRevisions() for the file. Getting the latest revision from that list.
Is this API correct to do this task or is there anything to help ?
Thanks
Aman
Thanks for the response.
Using Dropbox Java SDK v4.0.1 for development. I am trying to restore deleted files using -
files().restore(path, rev)
But its throwing an error "invalid_revision".
I am getting path from metadata for deleted file in listFolder() with includeDeleted = true.
And I am getting rev from listRevisions() for the file. Getting the latest revision from that list.
Is this API correct to do this task or is there anything to help ?
Thanks
Aman
Greg-DB
Dropbox Community Moderator
4 years agoAmanSingh The listFolder/listFolderContinue methods are the right way to list the contents of a folder, the listRevisions method is the right way to list the versions of a file, and the restore method is the right way to restore a deleted file. I just gave these a try myself and they are working properly for me. If it's not working for you, please share the rest of the relevant code and output so we can take a look at what's not working for you specifically. Thanks!
- AmanSingh4 years agoExplorer | Level 3
Hi,
Thanks for the information.
So, that's my sample code -String path = "/testaman6.dwg";
List<FileMetadata> revisions = new AWSXRayDbxClientV2(api, xRay).files().listRevisions(path).getEntries();
String rev = revisions.get(0).getRev();
new AWSXRayDbxClientV2(api, xRay).files().restore(path, rev);Inputs for restore function -
path - /testaman6.dwgrev - 015d183052af6b300000002296c5930
Error I am getting - Exception in 2/files/restore: "invalid_revision"- Greg-DB4 years ago
Dropbox Community Moderator
AmanSingh Thanks! That code itself looks fine, so it sounds like there's something specific to your account/files relevant here. Could you please open an API ticket and share the entire output you get from 'new AWSXRayDbxClientV2(api, xRay).files().listRevisions(path)' itself? That should help us investigate internally. Thanks in advance and apologies for the bother.
- AmanSingh4 years agoExplorer | Level 3
Thanks for the information.
I have raised a ticket for this - https://www.dropbox.com/support/ticket/15701428
Hope for a quick response.
Thanks
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!