为什么我要禁止403,在Microsoft Graph中获取其他用户的日历?

时间:2020-10-14 08:08:58

标签: android microsoft-graph-api

在Microsoft Graph中获取会议室日历时遇到了问题。

  1. 首先,我尝试使用Microsoft Explorer通过以下方式模拟请求:

https://graph.microsoft.com/v1.0/users/conference_room_ID_or_name/events

它得到403禁止访问-“访问被拒绝。请检查凭据,然后重试。”。 实际上,我已通过管理员设置了所需的权限:日历。阅读,Calendars.ReadWrite。我可以将这样的日历手动添加到我的Outlook网页,然后看到所有事件。但是在Microsoft Explorer中获得这样的请求是行不通的。 为了确保安全,我还在获得许可的Microsoft Azure中注册了我的应用。

  1. 我还尝试了另一种方法:

https://graph.microsoft.com/v1.0/me/calendars/shared_calendar_id_in_my_account/calendarView

它正在获取事件,但不是全部事件-我确定这些事件是由我在会议室创建的,但是我无法获取其他人创建的所有事件-例如重复发生的事件。

我不确定是否是Graph的权限问题或任何已知(或不知道)问题,例如:

https://docs.microsoft.com/en-us/graph/known-issues#accessing-a-shared-calendar

感谢您的帮助。

干杯!

1 个答案:

答案 0 :(得分:0)

很明显,您授予了错误的权限。对于/users上下文,没有用户登录。您需要授予应用程序权限。

enter image description here

列出其他用户的events

GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/calendars/{id}/events