OneDrive Graph API: Get User ID associated with drive ID

767 Views Asked by At

I have an ID of an OneDrive drive. Is there any way I can figure out the user ID to whom the OneDrive drive belongs to?

1

There are 1 best solutions below

0
On BEST ANSWER

When you call

GET /drives/{drive-id}

it returns Drive resource type with Owner property. It's the user account that owns the drive and it includes user id.

{
    "id": "b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7",
    "driveType": "business",
    "owner": {
        "user": {
            "id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
            "displayName": "John Doe"
        }
    },
    ...
}