question

HarryPotter-5183 avatar image
0 Votes"
HarryPotter-5183 asked Danstan-MSFT answered

OneDrive - Search My Drive - or condition for multiple type of file

Working https://graph.microsoft.com/v1.0/me/drive/root/search(q='.mp3 or .acc')?select=name,id,webUrl


Here in q I want to pass multiple value for two its working I want to search four types of Files.

.mp3 .acc .m4a .wav

Not Working - https://graph.microsoft.com/v1.0/me/drive/root/search(q='.mp3 or .acc or .wav or .m4a')?select=name,id,webUrl


microsoft-graph-search
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Danstan-MSFT avatar image
0 Votes"
Danstan-MSFT answered

For this kind of search, you should use the search API. Here is a example to search your files.


 POST https://graph.microsoft.com/v1.0/search/query
    
 {
     "requests": [
         {
             "entityTypes": [
                 "driveItem"
             ],
             "query": {
                 "queryString": ".mp3 OR .wav OR .m4a"
             }
         }
     ]
 }


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.