Search code examples
microsoft-graph-apionedrive

Microsoft graph API: /me/drive/root/search - can't add filters to query


I'm trying to make search request for my OneDrive files with some specific extensions. Only solution I've got right now is to filter out after received response but that's not what I'm looking for. Query I tried:

https://graph.microsoft.com/v1.0/me/drive/root/search(q='book filetype:xlsx OR filetype:xls OR filetype:svg OR filetype:json OR filetype:txt')

Unfortunately it's not returning anything.


Solution

  • AFAIK, the search endpoint will search the keyword like 'book' with all the extensions and give the driveItem objects as response. You need to filter it on your end which extension you like to pick by writing the code. Please raise a feature request in Microsoft Graph Feedback Forum so that the Product team may implement it in future.