I am using REST API to move file from one folder to another in OneDrive for Business. This is working fine with in the same user folders. But when I try to move file from one user folder to another user folder it is throwing exception "Value does not fall within the expected range". Following is my REST call
https://abc-my.sharepoint.com/personal/x_x_office365_myshn_net/_api//web/GetFileByServerRelativeUrl(@oldpath)/moveto(newurl=@newpath)?@oldpath='/personal/x_x_office365_myshn_net/Documents/test.txt'&@newpath='/personal/y_y_office365_myshn_net/SHNQuarantineLibrary/Quarantine/test.txt'
My user1: x_x_office365_myshn_net and user2:y_y_office365_myshn_net. Let me know if I am missing anything or if there are any other alternatives available to achieve this functionality.