API to get deleted drive items in Onedrive

Aman Singh 26 Reputation points
2022-02-01T05:18:17.19+00:00

Hi,

I am trying to get my deleted files and folders in onedrive using API.
But I couldn't find anything appropriate.

Is there any endpoint available for this task OR any other possible way.

Thanks
Aman

Microsoft Graph Files API
Microsoft Graph Files API
A Microsoft API to create an app that connects with files across OneDrive, OneDrive for Business, and SharePoint document libraries.
390 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,242 questions
{count} votes

Accepted answer
  1. Shivam Dhiman 5,786 Reputation points
    2022-02-01T15:31:14.813+00:00

    Hi @Aman Singh

    Use the includeDeletedItems=true query parameter to return deleted items. This query parameter is only valid when targeting a driveItem by ID, and otherwise will be ignored.

    GET /me/drive/items/{item-id}  
    

    This is currently only supported on OneDrive Personal.
    source: driveitem-get

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful