question

MudgalKritika-5573 avatar image
1 Vote"
MudgalKritika-5573 asked JeffLamb-1904 commented

Microsoft Graph API for Restoring/Accessing Recycle Bin content of OneDrive for Business

Hi Team,

I am leveraging Microsoft Graph API for accessing and downloading files from OneDrive. However, I am unable to find any Graph API to access and restore the items from Recycle Bin of OneDrive for Business.

Could you please help with the API to restore data from Recycle bin?

Thank you.



microsoft-graph-all
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Team,

I request urgent help on this.

Thanks

0 Votes 0 ·

I use a PowerShell restore script with the PnPOnline module that uses this API to restore files from a user's ODfB recycle bin:

 $apiCall = $siteUrl + "/_api/site/RecycleBin/RestoreByIds"
 $body = "{""ids"":["

 # Loop this line to add all your file ids:
 $body += """" + $Id + """"
    
 # Close the body, then invoke:
 $body += "]}"
 Invoke-PnPSPRestMethod -Method Post -Url $apiCall -Content $body | Out-Null


0 Votes 0 ·

1 Answer

DianaWanjuhi-1579 avatar image
0 Votes"
DianaWanjuhi-1579 answered GalewPatrick-6394 commented

HI @MudgalKritika-5573 there currently is no API to access and restore items from the Recycle Bin for OneDrive for Business. This feature has been requested by other community members, kindly upvote it here.

I hope this helps,

Diana.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The upvoting link is no longer available.

0 Votes 0 ·