API to get deleted drive items in Onedrive

Aman Singh 31 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
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,902 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,952 questions
{count} votes

Accepted answer
  1. Shivam Dhiman 6,056 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.