Graph API not working in Power Automate HTTP element

Kees Vonk 0 Reputation points
2023-05-31T12:19:08.46+00:00

I am trying to get the drive-ids of a SharePoint site. In order to do that I use the following element:

Power Automate

The URI is in the form of:

https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com:xxxx.sharepoint.com,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/drives

The result is this (status code 200):

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

When I try exactly the same URI in Graph Explorer, I get this:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
    "value": [
        {
            "createdDateTime": "2022-10-16T00:17:42Z",
            "description": "",
            "id": "b!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "lastModifiedDateTime": "2023-01-04T05:44:57Z",
            "name": "Documents",
            "webUrl": "https://xxxx.sharepoint.com/sites/xxxxxxxx/Shared%20Documents",
            "driveType": "documentLibrary",
            "createdBy": {
                "user": {
                    "displayName": "System Account"
                }
            },
            "lastModifiedBy": {
                "user": {
                    "email": "x.x@xxxx.xxx",
                    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
                    "displayName": "x x"
	                }
            },
            "owner": {
                "group": {
                    "email": "xxxxxxxx@xxxx.onmicrosoft.com",
                    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
                    "displayName": "xxxxxxxx xxxx xxxx"
                }
            },
            "quota": {
                "deleted": 1794912,
                "remaining": 27487786218381,
                "state": "normal",
                "total": 27487790694400,
                "used": 2681107
            }
        }
    ]
}

Both applications have the following permissions:

  • Files.ReadWrite.All
  • Sites.ReadWrite.All

 

Can anyone tell me why I am getting different results in the two applications?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,410 questions
0 comments No comments
{count} votes