首页 文章

尝试通过 MS Graph API 检索房间日历时 ErrorItemNotFound

提问于
浏览
4

在检索用户日历的日历视图(代表用户)旁边,我们正在努力通过 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,因此不应该是一个问题,由文件判断。

有谁知道如何解决这个问题?

2 回答

  • 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都是三个。

    这不是权利问题,因为对于我的测试,我授予了图形浏览器 Directory.ReadWrite.All范围。导致以下scp索赔。
    范围截图

    第一个请求似乎是最有希望的(因为不同的错误),我也使自己成为一个完全控制 rooms-mailbox 的代表。那仍然没有帮助。

    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"
    }
    

    完成所有这些测试后,我只能得出结论,您无法访问房间邮箱中的事件。这是预期的(如仅使用调度助手)或错误。

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

  • 0

    最后!经过这个与无数微软支持人员,每个人说这不是他们的领土,不知道在哪里转发问题,我与交流团队的人联系。他建议一件对我们有用的事情:代表您正在检索房间资源日历的用户需要是该房间资源的代表

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

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

相关问题