0
votes

I am using Microsoft Graph API to select a list of drives (used the following end point https://graph.microsoft.com/v1.0/drives)

This returns the following response

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
    {
        "createdDateTime": "2020-08-04T02:41:25Z",
        "description": "",
        "id": "b!cMaCrLYg0Eebp_dXxJrwY",
        "lastModifiedDateTime": "2020-08-05T11:45:01Z",
        "name": "DocLibrary1"
    },
    {
        "createdDateTime": "2020-08-04T02:41:25Z",
        "description": "",
        "id": "b!cMaCu321321jJDASJA",
        "lastModifiedDateTime": "2020-08-05T11:45:01Z",
        "name": "DocLibrary2"
    }  ]}

Now how can I change the URL request to only fetch attibutes where name = 'DocLibrary1'?

1
When I test in the Microsoft Graph API Explorer the following Odata filtration works for list of users graph.microsoft.com/v1.0/users?$filter=givenName eq 'Adele' but it does not work for drives graph.microsoft.com/v1.0/drives?$filter=name eq 'Documents' Is this a known issue with Microsoft Graph API?Artha Wijendra
Filtering by the technical name does not seem to work for lists and drives. Is your drive a SharePoint drive? If yes, you can try to use the localized displayName to retrieve the underlying list (see stackoverflow.com/questions/61143146/…) and then get the drive via the list.Marc
I have added this as a request for Microsoft Graph API (as it works with eh other endpoints of the Graph API) microsoftgraph.uservoice.com/forums/… Please go and vote!Artha Wijendra

1 Answers

0
votes

This seems to be a limitation. I have added this as a request for Microsoft Graph API (as it works with eh other endpoints of the Graph API)

https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/41172841-microsoft-graph-api-odata-support-to-fetch-dri

Please go and vote!