我需要通过REST API访问域中的所有用户文件 . 我只能通过正常OAUTH流授予的访问令牌访问域用户的文件 .
我找到了这篇文章:Building Daemon or Service Apps with Office 365 Mail, Calendar, and Contacts APIs (OAuth2 client credential flow)
本文仅提及Mail,Calendar和Contacts API . 是否支持File API?
这对我有用:
创建一个access_token,如https://graph.microsoft.io/en-us/docs/authorization/app_only所述,并在Authorization标头的后续步骤中使用它
获取使用此REST API的所有用户:https://graph.microsoft.com/v1.0/users
遍历用户并使用此API获取文件(在URL中添加userPrincipalName):https://graph.microsoft.com/v1.0/users/user@xxxx.onmicrosoft.com/drive/root/children
1 回答
这对我有用:
创建一个access_token,如https://graph.microsoft.io/en-us/docs/authorization/app_only所述,并在Authorization标头的后续步骤中使用它
获取使用此REST API的所有用户:https://graph.microsoft.com/v1.0/users
遍历用户并使用此API获取文件(在URL中添加userPrincipalName):https://graph.microsoft.com/v1.0/users/user@xxxx.onmicrosoft.com/drive/root/children