【问题标题】:ErrorItemNotFound when trying to retrieve room calendar via MS Graph API尝试通过 MS Graph API 检索房间日历时出现 ErrorItemNotFound
【发布时间】:2019-05-13 08:15:17
【问题描述】:

除了(代表用户)检索用户日历的日历视图之外,我们还努力通过 Graph API 使用以下方法获取房间的日历视图 https://graph.microsoft.com/beta/users/room1@ourdomain.com/calendarView。这是一个痛苦的过程,因为我们遇到了很多问题,目前陷入以下404 回复:

https://graph.microsoft.com:443/v1.0/users/room1@ourdomain.com/calendarView?startDateTime=2018-12-04T23:00:00.000Z&endDateTime=2019-02-10T22:59:59.999Z

{
  "error": {
    "code": "ErrorItemNotFound",
    "message": "The specified object was not found in the store.",
    "innerError": {
      "request-id": "358a003a-57a4-4f0e-91da-edc17c1fa2d8",
      "date": "2018-12-12T07:38:33"
    }
  }
}

房间的电子邮件地址已经过双重检查并且资源存在,因为我们可以使用它创建约会,并且当我们检索在该位置有约会的用户的日历时,它甚至会在响应中返回。

应用权限和 OAuth2 范围设置为:openid email profile offline_access https://graph.microsoft.com/Calendars.Read https://graph.microsoft.com/Calendars.Read.Shared https://graph.microsoft.com/User.Read https://graph.microsoft.com/User.ReadBasic.All https://graph.microsoft.com/User.Read.All,因此从the documentation 判断,这应该不是问题。

有人知道怎么解决吗?

【问题讨论】:

  • 请求https://graph.microsoft.com:443/v1.0/users/room1@ourdomain.com会得到什么?
  • 返回错误代码Request_ResourceNotFound,描述为Resource 'room1@ourdomain.com' does not exist or one of its queried reference-property objects are not present.。但我再次仔细检查,并在预约时定义了正确名称的资源并可用。

标签: microsoft-graph-api


【解决方案1】:

我已经尝试了所有可能的方法,但无法访问。 这是我在 Graph explorer 中尝试过的:

  • https://graph.microsoft.com/v1.0/users/meetingroom1@domain.com/events -> DelegatedCalendarAccessDenied
  • https://graph.microsoft.com/v1.0/users/meetingroom1@domain.com/calendarView?startDateTime=2019-01-14&endDateTime=2019-01-18 -> ErrorItemNotFound
  • https://graph.microsoft.com/v1.0/users/meetingroom1@domain.com/calendar/calendarView?startDateTime=2019-01-14&endDateTime=2019-01-18 -> ErrorItemNotFound

v1.0beta 上的所有三个。

这不是权限问题,因为对于我的测试,我将Graph Explorer 授予Directory.ReadWrite.All 范围。导致以下scp 声明。

第一个请求似乎最有希望(因为不同的错误),我还让自己成为了完全控制房间邮箱的代表。这仍然没有帮助。

https://graph.microsoft.com/v1.0/users/meetingroom1@domain.com 的请求会给出结果,就像描述会议室的结果一样。

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "businessPhones": [],
    "displayName": "Meeting room 1",
    "givenName": null,
    "jobTitle": null,
    "mail": "meetingroom1@domain.com",
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": null,
    "userPrincipalName": "meetingroom1@domain.com",
    "id": "3e0a7b7e-xxxx-xxxx-xxxx-xxxxcxxxx120"
}

在完成所有这些测试之后,我只能得出结论,您无法访问房间邮箱中的事件。这要么是有意的(因为只使用调度助手),要么是一个错误。

也许这里的一些微软人员可以澄清这一点?

【讨论】:

  • 我希望这里的一位微软老兄能注意到这个详细的问题并为我们提供解决方案。在其他地方发现有一个额外的权限(共享日历),但还没有尝试过。
  • 到目前为止,我完成这项工作的唯一方法是使用全局管理员帐户和这种身份验证方法:docs.microsoft.com/en-us/graph/…
  • 我还没有找到解决办法;我一直在尝试联系 Microsoft 支持部门的合适人员,但到目前为止还没有成功。找到解决方案后我会更新。
  • 现在,我遇到了同样的问题。有人解决了吗?
【解决方案2】:

终于!在与无数 Microsoft 支持人员一起经历了这件事之后,每个人都说这不是他们的领域,并且不知道将问题转发到哪里,我与 Exchange 团队的某个人取得了联系。他建议了对我们有用的一件事:您代表其检索房间资源日历的用户需要成为该房间资源的代表

此外,为了检索用户可以选择的房间资源列表,我们需要使用findRooms 端点,但这仅适用于 beta API。唯一的缺点是您似乎无法过滤用户是代表的房间。因此,用户将获得他可能无法检索日历的房间列表。

房间资源 calendarView 响应的最后一个缺点是响应不包含房间中计划的会议的名称。每个事件的描述仅包含会议组织者的名称。

【讨论】:

  • 我知道已经有一段时间了,但我正在处理同样的问题。首先,仅供参考,为了保密,主题默认是隐藏的。可以使用 Set-CalendarProcessing cmdlet 上的 -DeleteSubject 和 -AddOrganizerToSubject 处理选项使其可见。请参阅docs.microsoft.com/en-us/powershell/module/exchange/… 事实上,我设法让它在同一个 cmdlet 上使用 -ResourceDelegates 选项。任何人。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-10
  • 1970-01-01
  • 1970-01-01
  • 2021-03-27
  • 2021-03-13
相关资源
最近更新 更多