Search code examples
filtermicrosoft-graph-apiodatafilteringmicrosoft-graph-files

Microsoft Graph Drives Filter doesn't apply


I try to get SharePoint library by name using Micrsoft Graph.

Following query return names of two libraries (drives, to be more precise): https://graph.microsoft.com/v1.0/sites/SiteID/drives?$select=name,id

Result:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives(name,id)",
    "value": [
        {
            "id": "b!AzzEy..............MAZI5",
            "name": "Dokumenty"
        },
        {
            "id": "b!AzzEy.............B-G2yh",
            "name": "serwis"
        }
    ]
} 

To return only one by name, I do such $filter

https://graph.microsoft.com/v1.0/sites/SiteID/drives?$select=name,id&$filter=name eq 'serwis'

but it doesn't work - it return all drives.

Where is problem in URL?


Solution

  • Unfortunately the $filter does not work against the Drives endpoint.Please feel free to upvote the feature ask here - https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/41172841-microsoft-graph-api-odata-support-to-fetch-dri