Is there a way to get the meta for a deleted item (file / folder) for Office365 OneDrive via REST API?
I'm looking for a way to get the meta for a deleted item (file / folder). I can get change logs indicating that a certain action was taken on an item, and I was also able to get the item itself if it wasn't deleted.
The problem arises when this item is removed. In this case, I only know the id of the element, and when I query the element itself, I get a 404 (the talking object has been deleted).
I recently read the following posts
- http://office.microsoft.com/en-001/windows-sharepoint-services-help/view-restore-or-delete-items-in-the-recycle-bin-of-a-sharepoint-site-HA010021434. aspx
It says that the deleted item is sent to the user's trash, where it can be restored or deleted permanently. If it is removed from the Recycle Bin, it will go to the Recycle Bin of Sites where the administrator can restore or delete it permanently. So now I'm looking for a way to access the Recycle Bin for the user as well as the Recycle Bin for a site collection via the REST API.
Although I know the endpoints of the recycle bin mentioned here , they don't work for me as I keep getting an empty array even though I have a couple of files / folders present in the recycle bin (users' recycle bin ). Perhaps I am missing the settings / settings?
I have 2 goals;
- Find the file (one deleted) in the user's recycle bin. (/ Perosonal / abc_tenant_onmicrosoft_com)
- If it is not, look for the file in the recycle bin of the sites recycle bin.
Both of them are via REST APIs.
source to share
Cart resource endpoint URI:
How to distinguish cart items
The following query demonstrates how to return
http://<onedrive for business url>/_api/web/RecycleBin?$filter=(ItemType eq 1)
and the following is how to return
http://<onedrive for business url>/_api/web/RecycleBin?$filter=(ItemType eq 5)
where the token
<onedrive for business url>
for the OneDrive For Business site has the following format:
source to share