Search code examples
azuremicrosoft-graph-apisharepoint-onlineazure-gov

Graph API - how to list site drives in GCC High Environment?


How can I list a SharePoint site's drives using the Graph API for GCC High environments? It works when using the same endpoint in my standard environment. I'm able to list all of the drives. However, in my client's GCC High environment, with the same exact API Permissions on the App Registration in Azure, I can't get it to list anything. It just returns an empty array with a 200 status.

Graph API Endpoint: https://graph.microsoft.us/v1.0/sites/{{site-id}}/drives

Response:

{
    "@odata.context": "https://graph.microsoft.us/v1.0/$metadata#drives",
    "value": []
}

API Permissions enter image description here

This endpoint will return the site's metadata however: https://graph.microsoft.us/v1.0/sites/{{site-id}}

    {
        "@odata.context": "https://graph.microsoft.us/v1.0/$metadata#sites/$entity",
        "createdDateTime": "2022-10-05T17:42:12.63Z",
        "description": "",
        "id": "{{site-id}}",
        "lastModifiedDateTime": "2022-10-06T10:13:56Z",
        "name": "DocumentCenter",
        "webUrl": "{{site-url}}",
        "displayName": "{{site-name}}",
        "root": {},
        "siteCollection": {
            "hostname": "{{host-name}}"
        }
    }

Solution

  • After speaking with a Microsoft support specialist I found that my "Grant Type" within my Authorization settings in Postman were incorrect. I was using an Authorization Code, and I needed to use Client Credentials. My App Registration had Application permissions, not Delegated for the SharePoint permissions. So the call was not authorized to return SharePoint lists until I switched to the Client Credential Grant Type.

    enter image description here