Search code examples
azure-active-directorymicrosoft-graph-apionedrive

Filter Microsoft Graph Drive Search Results where Modified By is Current User


I'm attempting to get Drive results using Microsoft Graph that are filtered by the current user.

This is as far I have gotten, which is return results sorted by last modified date, but it's returning results modified by other users.

I want it to only return results where last modified or preferably modified at all by the current user. Is there a way to do that?

So far, I have tried throwing in {User.Name} around the place, but that hasn't gotten me anywhere

https://graph.microsoft.com/v1.0/me/drive/search(q='')?$orderby=lastModifiedDateTime desc

Or is this fruitless, and I should use the insights/used endpoint even though it's in beta?

https://graph.microsoft.com/beta/me/insights/used

Cheers


Solution

  • Yes, you could use the https://graph.microsoft.com/beta/me/insights/used to get results where last modified or preferably modified at all by the current user.

    But APIs under the /beta version in Microsoft Graph is in preview and are subject to change. Use of these APIs in production applications is not supported.

    For the details, please refer to here.