繁体   English   中英

Microsoft Graph API:如何使用 API 访问来宾日历事件?

[英]Microsoft Graph API: How to access guest calendar events using API?

我正在努力将 outlook 日历与我们的应用程序集成。 我正在尝试获取来宾用户的日历事件。 到目前为止,我已经完成了以下步骤。

在 Azure Active Directory 管理中心注册了一个应用程序并添加了以下 API 权限。

API 权限

然后我使用以下 API 调用来获取访问令牌。

https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token

我使用此令牌来获取工作正常的用户列表。

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

然后我使用此结果中的 user_id 来调用以下 API

https://graph.microsoft.com/v1.0/users/{user_id}/calendars
https://graph.microsoft.com/v1.0/users/{user_id}/calendars/events
https://graph.microsoft.com/v1.0/users/{user_id}/events

我为会员用户获得了成功的结果,但为来宾用户获得了以下错误

>AuthOMMissingRequiredPermissions
>The AadGuestPft token doesn't contain the permissions required by the target API.

知道我错过了什么吗?

要获得来宾用户(外部),您可以使用https://graph.microsoft.com/v1.0/users?$filter=userType eq 'Guest' Graph API 端点。 这将为您提供所有外部用户的详细信息作为回应。 事件 API 仅适用于租户内的用户,对于没有许可证的外部用户将不起作用。

希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM