Access the default drive of the root SharePoint site within a tenant

Standard way

You probably know that you can get the tenant's root site by calling

GET https://graph.microsoft.com/v1.0/sites/root
GET https://graph.microsoft.com/v1.0/sites/tenant_name.sharepoint.com

And to get the drive aka document library, simply add /drive to the url

GET https://graph.microsoft.com/v1.0/sites/root/drive
GET https://graph.microsoft.com/v1.0/sites/tenant_name.sharepoint.com/drive

You've probably used it at least once in your life.

But what if there is another way to access the document library of the default root site?

Undocumented way

I didn't find any notes in the doc about the second way to access the default drive, but here it is

GET https://graph.microsoft.com/v1.0/drive

Nice, isn't it. Easy to use, easy to remember.

Permissions

In both cases, you need Files.Read.All permission.

0
Buy Me a Coffee at ko-fi.com
An error has occurred. This application may no longer respond until reloaded. Reload x