Hi,
I'm using the latest Microsoft.Graph library in my .NET project with my SharePoint site. I wanted to create a endpoint to retrieve the items from the recycle bin, but found the following code obsolete because ".RecycleBin" is removed.
var deletedItems = await_graphClient
.Drives[_driveId]
.RecycleBin
.GetAsync();
Then I saw this documentation about the recycle bin items.
https://learn.microsoft.com/en-us/graph/api/recyclebin-list-items?view=graph-rest-1.0&tabs=csharp
However, the examples in the website above has http call like this:
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com,48f1898f-77d9-4a1b-bddc-1f49bb6dc134,7206fc09-e4af-48b3-8730-ed7321396d7a/recycleBin/items
While the C# code to get the items actually goes from the File Storage
// Code snippets are only available for the latest version. Current version is 5.x
var result = await graphClient.Storage.FileStorage.Containers["{fileStorageContainer-id}"].RecycleBin.Items.GetAsync();
What's even more confusing is that "fileStorageContainer-id" from the above example is not even defined. I have tried so many ways now trying to get the deleted items from my SharePoint site, but none of them worked. Please help me on the code of how to get the items from the recycle bin.
Thanks,
Simon