SOLVED

Discover Office 365 OneDrive for Business URL with “app-only” token

Copper Contributor

I found that it is possible to get URL from user One Drive 

https://graph.microsoft.com/v1.0/users/{user_id}/drive/root?select=webUrl

Is it possible to discover Office 365 OneDrive for Business URL with "app-only" token using single API endpoint from Graph API? 

4 Replies
best response confirmed by Yevhen Kryvun (Copper Contributor)
Solution

TLDR;

 

Yes, it is possible. For the app, create the app-only scopes of User.Read and Files.Read.

 

Details:

 

The User resource requires one of several possible permission scopes, documented at https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/users

 

The drive attribute (actually, the get-drive method) requires one of several possible permission scopes, documented at https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/drive_get.

 

The list of available scopes for App-Only requests (which require Admin Consent) are docuumented at https://developer.microsoft.com/en-us/graph/docs/authorization/permission_scopes.

 

 

 

 

@paulschaeflein can you correct URLs in "Details" section for first and second paragraphs.

Ha! I need to improve my copy/paste skills. :) Updates are made.
1 best response

Accepted Solutions
best response confirmed by Yevhen Kryvun (Copper Contributor)
Solution

TLDR;

 

Yes, it is possible. For the app, create the app-only scopes of User.Read and Files.Read.

 

Details:

 

The User resource requires one of several possible permission scopes, documented at https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/users

 

The drive attribute (actually, the get-drive method) requires one of several possible permission scopes, documented at https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/drive_get.

 

The list of available scopes for App-Only requests (which require Admin Consent) are docuumented at https://developer.microsoft.com/en-us/graph/docs/authorization/permission_scopes.

 

 

 

 

View solution in original post