尝试通过 MS Graph API 检索房间日历时出现 ErrorItemNotFound [英] ErrorItemNotFound when trying to retrieve room calendar via MS Graph API

查看:24
本文介绍了尝试通过 MS Graph API 检索房间日历时出现 ErrorItemNotFound的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Next to retrieving calendar views of a user's calendar (on behalf of the user), we are trying hard to also get the calendar view of rooms via the Graph API using https://graph.microsoft.com/beta/users/room1@ourdomain.com/calendarView. It's a painful process since we've been running into many problems and are currently stuck with the following 404 response:

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

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

The email address of the room has been double checked and the resource exists, since we can create appointments with it and it is even being returned in the response when we retrieve the calendar of the user who has an appointment in that location.

应用权限和 OAuth2 范围设置为:openid email profile offline_access https://graph.microsoft.com/Calendars.Read https://graph.microsoft.com/Calendars.Read.Shared https:///graph.microsoft.com/User.Readhttps://graph.microsoft.com/User.ReadBasic.All https://graph.microsoft.com/User.Read.All,所以从 文档.

App permissions and OAuth2 scopes are set to: 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, so that should not be an issue, judging by the documentation.

有人知道怎么解决吗?

推荐答案

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

FINALLY! After going through this with countless Microsoft support people, each of whom said this was not their territory and did not know where to forward the question, I got in touch with somebody from the Exchange team. He suggested the one thing that worked for us: the user on behalf of which you are retrieving the room resource calendar needs to be a delegate of that room resource!

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

In addition, to retrieve the list of room resources which the user can select from, we needed to use the findRooms endpoint but this only works on the beta API. The only drawback of this is that you cannot seem to filter for rooms of which the user is a delegate. So the user will get a list of rooms for which he might or might not be able to retrieve the calendar.

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

A final drawback of the room resource calendarView response is that the response does not contain the names of the meetings planned in the rooms. The description of each event only contains the name of the meeting organizer.

这篇关于尝试通过 MS Graph API 检索房间日历时出现 ErrorItemNotFound的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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