Forum Discussion
Discover Office 365 OneDrive for Business URL with “app-only” token
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?
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.
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.
- Yevhen KryvunCopper Contributor
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.