GRAPH Explorer lists deleted (shared) files from OneDrive

Kaj Overdevest 46 Reputation points
2022-03-28T16:47:21.027+00:00

Hi,

The https://graph.microsoft.com/v1.0/me/drive/sharedWithMe Graph Explorer API Call should list all objects that are shared with a specific user in Sharepoint/OneDrive. We use this API call to identify certain .xlsx WorkbookIds for which we then identify sheets, etc.

However, files that have been completely deleted from OneDrive/Sharepoint still occur in the list that this API call returns. Why are these still visible through this API call? For example, when trying to access the WebUrl of one of the items that has been deleted we see the following page:

187567-image.png

The above message is obviously correct, since the file has been deleted from Sharepoint (also from the recycle bin). But it should not occur in the /sharedWithMe API Call, which it still does for some reason.

Kind regards,
Kaj

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,564 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,663 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 36,891 Reputation points
    2022-03-29T10:13:54.697+00:00

    Hi @Kai-chest-007

    This seems to be by design, I can reproduce your problem locally, even if the owner of the file deletes the file in OneDrive, we are still able to get it via the graph api. I'm not sure if this is intentional, but it's definitely not a good user experience because it creates confusion.

    I recommend that you submit a user voice to the MS graph product team to standardize the graph api's response, files that have been deleted should definitely not be present in the /sharedWithMe API call.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Kaj Overdevest 46 Reputation points
    2022-03-30T07:04:22.57+00:00

    Hi CarlZhao-MSFT,

    Thanks a lot for your response. I was just submitting the user voice, but wanted to give the /sharedWithMe Call another shot. When I make this Call right now, the file that I deleted does not show up in the list anymore. That is a bit weird.

    Could it be that there is some sort of delay? I will submit a 'user voice' in which I mention that the file is not in the Call anymore but it still seems like a bug to me. After deleting a file, it should immediately disappear from the /sharedWithMe Call.

    Kind regards,
    Kaj

    1 person found this answer helpful.

  2. CarlZhao-MSFT 36,891 Reputation points
    2022-03-30T08:17:33.913+00:00

    Hi @Kai-chest-007

    What is certain now is that there is a long delay with the api endpoint, I just tried calling the /sharedWithMe endpoint again and it doesn't return the file that was deleted before. But the long delay is still a bug and it should be fixed immediately.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.