Office365 REST API - 日历事件附件对收件人不可见 [英] Office365 REST API - Calendar event attachments not visible for recipients

查看:27
本文介绍了Office365 REST API - 日历事件附件对收件人不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

添加附件 端点似乎有问题.附加到日历事件的文件对日历收件人不可见.附件对事件创建者可见.直到最近,我的代码已经运行了几个月,这让我相信这是一种回归.

The add attachment endpoint seems buggy. Files attached to a calendar event are not visible to the calendar recipients. The attachments are visible to the event creator. My code had been working for months until recently, which leads me to believe this is a regression.

  1. 必须有两个用户 - 创建者和接收者.
  2. 通过 https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
  3. 创建一个事件
  4. 通过 https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments 将文件附加到活动中
  5. 以创建者身份转到 Office 365 Web UI.活动看起来不错,包含附件.
  6. 以创建者身份查询 Microsoft 图形 API.活动看起来不错.hasAttachmentstrue 并且通过 API 列出附件按预期工作.
  7. 以收件人身份转到 Office 365 Web UI.该事件缺少附件(有关该事件的所有其他内容都是准确的).
  8. 以收件人身份查询 Microsoft 图形 API.hasAttachmentsfalse 并且您不能使用图形 API 列出附件.为了获取收件人的事件 ID,我查询了 /calendarView 端点.它返回与第 4 步中的事件不同的事件 id,但对象的其余部分匹配(iCalUId、主题、开始/结束时间等)...除了 hasAttachments.李>
  1. There must be two users - the creator and the recipient.
  2. Create an event via https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
  3. Attach a file to the event via https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
  4. Go to the Office 365 web UI as the creator. The event looks good and includes the attachment.
  5. Query the Microsoft graph API as the creator. The event looks good. hasAttachments is true and listing the attachments via the API works as expected.
  6. Go to the Office 365 web UI as the recipient. The event is missing the attachment (everything else about the event is accurate).
  7. Query the Microsoft graph API as the recipient. hasAttachments is false and you can not list the attachments with the graph API. To get the recipient's event ID, I queried the /calendarView endpoint. It returns a different event id than the event in step 4, but the rest of the object matches (iCalUId, subject, start/end times, etc)...with the exception of hasAttachments.

已尝试修复

我尝试通过 /users/{userId} 端点而不是 /me 端点创建事件并附加文件,结果相同.

Fixes attempted

I tried creating the event and attaching the file via the /users/{userId} endpoints instead of the /me endpoints with the same results.

我也尝试了添加附件 beta 端点,但收到以下错误:

I also tried the add attachment beta endpoint but received the following error:

{
  "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 的解决方法解决了这个问题 - 在附件 之后添加与会者.工作流程如下:

Marc's workaround fixes the issue - add the attendees after the attachments. A working flow looks like:

  1. 通过 POST 到 https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events 创建一个活动(不包括与会者).
  2. 通过 POST 将文件附加到事件中 https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
  3. 通过 PATCH 将第 1 步与与会者的活动更新到 https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}
  1. Create an event (excluding attendees) via POST to https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events.
  2. Attach a file to the event via POST to https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
  3. Update the event from step 1 with the attendees via PATCH to https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}

一些额外的请求,但它完成了工作.

A few extra requests, but it gets the job done.

这篇关于Office365 REST API - 日历事件附件对收件人不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆