Share via

How to filter DriveItems by shared or shared:scope to see only items that have been shared by me

Michael Shelmet 0 Reputation points
2023-12-08T14:51:13.8866667+00:00

I am trying to use Graph Explorer to return all of the results from my OneDrive where the shared element exists for a driveitem using the following GET v1.0:

https://graph.microsoft.com/v1.0/me/drive/root/children?$select=name,shared&$filter=shared ne null

When I use that, I get an "Operation not supported" message in return. I also have the same issue if I try to pull back shared:scope to see if it is set to "users" in an attempt to identify files that have been shared out.

Is there any way to filter the results so that I only see driveitems that have the shared property or, more specifically, those that have a shared:scope of "users"? I understand that there is the files shared with me call, but I am looking for the files I shared, not ones shared with me. I can see this in the web interface for OneDrive, so I am looking to create it through Graph Explorer.

Microsoft Security | Microsoft Graph

1 answer

Sort by: Most helpful
  1. AsithwMSFT 1,520 Reputation points Microsoft External Staff
    2023-12-10T21:52:32.32+00:00

    Currently MS Graph does not have an endpoint to get the list of files you shared.

    https://github.com/microsoftgraph/microsoft-graph-devx-api/issues/620

    https://learn.microsoft.com/en-us/answers/questions/543673/using-the-graph-api-is-there-a-way-to-list-shares

    however, OneDrive rest api support below endpoint

    Note: this API is only available on OneDrive Personal.

    GET /drive/shared
    

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

    0 comments No comments

Your answer

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