I've got a problem with the REST API that admit to restore deleted items from SharePoint online:
_api/web/recyclebin('<recycle bin item id>')/restore()
My problem is in the specific case where after the deletion of the file and before of the restoration, someone put a file with the same name in the place where the old file was.
In this situation the HTTP request for the restoration of the file goes in "BadRequest".
If I try to perform this same operation but in the standard way (go in the recycle bin manually and restore the file) the file will be correctly restored with the name changed in <file name>(1).<extension>
Why the REST API does not perform the same operation but instead it totally fails?