首页 > 解决方案 > Microsoft Graph beta findRooms 不返回 userPrincipalName

问题描述

使用/beta/users/xxx/findRooms调用时,API 返回电子邮件地址(和姓名)列表。

在大多数情况下,电子邮件地址与 相同userPrincipalName,可用于进一步查找(例如/v1.0/users/<email>/calendarView...)。

但是,如果房间被重命名,并且关联的电子邮件地址发生了变化:

userPrincipalName这意味着必须进行额外的查找才能将返回的名称或电子邮件地址转换id为查找所需的名称或电子邮件地址/users/xxx/...

如果findRooms返回房间的userPrincipalName和/或id而不仅仅是姓名和电子邮件,那就太好了。

在 Microsoft 修复此问题之前:

标签: office365microsoft-graph-api

解决方案


始终返回 userPrincipalName 不是默认行为,因此您可以在UserVoice中提交功能请求或对现有请求进行投票。

is there a way to get that additional information in findRooms? I couldn't find one.

没有。目前没有合适的方法

is there a way to use the returned e-mail directly in users/xxx/calendarView when the e-mail is not the userPrincipalName?

不,要获取特定用户,我们必须使用以下端点(它需要 userid 或 userPrincipalName):

GET /users/{id | userPrincipalName}

推荐阅读