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

Harry Potter 1 Reputation point
2021-07-06T10:47:00.043+00:00

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

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,816 Reputation points Microsoft Employee
    2021-07-07T07:42:40.607+00:00

    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"  
                }  
            }  
        ]  
    }  
    
    0 comments No comments