使用Microsoft Graph无需用户登录即可访问日历事件

时间:2020-04-13 10:32:34

标签: microsoft-graph-api microsoft-graph-calendar

我需要在没有用户登录的情况下访问Microsoft Graph的帮助。到目前为止,我正在尝试访问events/端点,但未成功。

来自以下图形API应用
Graph API App
,具有以下权限 enter image description here
及以下帐户类型
enter image description here

我可以获得userless access token enter image description here
,我也可以访问users enter image description here
,还可以访问id
{{3 }}
但不是日历
enter image description here

尽管HTTP响应代码为401 Unauthorized,但错误OrganizationFromTenantGuidNotFound看起来像是权限问题。

我想念什么?

TIA

1 个答案:

答案 0 :(得分:0)

要使用/users/{user-id}/events指示的用户才能正常通话user-id,如果使用客户端凭据,则必须在Exchange Online上具有邮箱。

您在评论中指出该用户是您的个人帐户,也许它已被添加为您组织中的“来宾”用户?在这种情况下,用户帐户将没有邮箱(mail属性为null才有意义),因此该调用将无法进行。