使用Graph Explorer时,我可以使用' List People'像这样的API:
https://graph.microsoft.com/beta/users/<user id>/people
<user id>
可以是组织中的任何用户。
但是,当我构建自己的应用程序时,我只能在登录用户上调用List People API。在另一个用户上调用它会得到一个拒绝许可的响应。
我应该使用什么范围,以便我可以在任何用户上使用列表人员?
根据List People API的文档
"The following scopes are required to execute this API: People.Read; People.ReadWrite"
但是People.Read只有"Allows the app to read a ranked list of relevant people of the signed-in user."
而People.ReadWrite
并不存在于权限范围列表中。
答案 0 :(得分:0)
尝试使用范围 User.ReadBasic.All ,它允许您获取组织中的所有用户 - 但不是所有属性。
一些资源:
答案 1 :(得分:0)
此调用类型需要People.Read.All,必须由管理员同意您的应用才能调用它。
文档在这里:MS Graph : List People