The 添加附件端点似乎有问题。附加到日历事件的文件are not对日历收件人可见。附件are对事件创建者可见。直到最近,我的代码已经运行了几个月,这让我相信这是一种回归。
重现步骤
- 必须有两个用户——创建者和接收者。
- 通过创建事件
https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
- 通过以下方式将文件附加到事件中
https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
- 以创建者身份转到 Office 365 Web UI。该事件看起来不错并且包含附件。
- 作为创建者查询 Microsoft Graph API。活动看起来不错。
hasAttachments
is true
并通过 API 列出附件按预期工作。
- 作为收件人转到 Office 365 Web UI。事件缺少附件(有关该事件的其他所有内容都是准确的)。
- 作为收件人查询 Microsoft Graph API。
hasAttachments
is false
并且您无法使用图形 API 列出附件。为了获取收件人的事件 ID,我查询了/calendarView
端点。它返回的事件 ID 与步骤 4 中的事件不同,但对象的其余部分匹配(iCalUId、主题、开始/结束时间等)...除了hasAttachments
.
尝试修复
我尝试创建事件并通过以下方式附加文件/users/{userId}
端点而不是/me
具有相同结果的端点。
我还尝试了添加附件 beta 端点,但收到以下错误:
{
"error": {
"code": "NavigationNotSupported",
"message": "Recursive navigation is not allowed after property 'Events' according to the entity schema.",
"innerError": {
"request-id": “{uuid}”,
"date": "2018-06-06T06:28:47"
}
}
}
Marc 的解决方法解决了该问题 - 添加与会者after附件。工作流程如下所示:
- 通过 POST 创建活动(不包括与会者)
https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
.
- 通过 POST 将文件附加到事件
https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
- 通过 PATCH 将步骤 1 中的参与者更新为
https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}
一些额外的要求,但它完成了工作。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)