api - Access all domain users' file in Office365 OneDrive -
i need access users' files in domain via rest api. access domain user's files via access token granted via normal oauth flow.
i found article: building daemon or service apps office 365 mail, calendar, , contacts apis (oauth2 client credential flow)
this article mentions mail, calendar, , contacts api. file api supported?
this worked me:
- create access_token described here https://graph.microsoft.io/en-us/docs/authorization/app_only , use in next steps in authorization header
- get users using rest api: https://graph.microsoft.com/v1.0/users
- iterate through users , files api (adding userprincipalname in url): https://graph.microsoft.com/v1.0/users/user@xxxx.onmicrosoft.com/drive/root/children
Comments
Post a Comment