[英]Display a list of upcoming birthdays of Office 365 users using Microsoft Graph API
Using the Microsoft Graph API, I want to create a list of all Office 365 users's birtdays, but I cannot get the list of users with the related properties at the moment.使用 Microsoft Graph API,我想创建所有 Office 365 用户生日的列表,但我目前无法获取具有相关属性的用户列表。
To set up this list I need the following properties exposed via the Graph API:要设置此列表,我需要通过 Graph API 公开以下属性:
Using the Graph Explorer, https://graph.microsoft.io/en-us/graph-explorer , I've tried to request my own properties (graph.microsoft.com/v1.0/Me/?$select=id,displayName,userPrincipalName,birthday) which works:使用图形资源管理器https://graph.microsoft.io/en-us/graph-explorer ,我尝试请求我自己的属性 (graph.microsoft.com/v1.0/Me/?$select=id ,displayName,userPrincipalName,birthday) 工作原理:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,userPrincipalName,birthday)/$entity",
"id": "aaaaaaaa-bbbbb-ccccc-a3c6-63817c4bbbca",
"displayName": "Harold van de Kamp",
"userPrincipalName": "harold@company.com",
"birthday": "2000-08-15T00:00:00Z"
}
When I query all users (graph.microsoft.com/v1.0/Users), that also works, but doens't contain all the required properties当我查询所有用户(graph.microsoft.com/v1.0/Users)时,这也有效,但不包含所有必需的属性
But when I query all users with the required properties (graph.microsoft.com/v1.0/Users/?$select=id,displayName,userPrincipalName,birthday), I get the following error:但是当我使用所需的属性(graph.microsoft.com/v1.0/Users/?$select=id,displayName,userPrincipalName,birthday)查询所有用户时,我收到以下错误:
{
"error": {
"code": "InternalServerError",
"message": "This operation is not yet supported.",
"innerError": {
"request-id": "06a7b9c9-2fcd-4f26-a86c-fe9704a35a1e",
"date": "2016-06-11T11:15:45"
}
}
}
Querying the beta API (graph.microsoft.com/beta/Users/?$select=id,displayName,userPrincipalName,birthday) results in the same error.查询 beta API (graph.microsoft.com/beta/Users/?$select=id,displayName,userPrincipalName,birthday) 会导致相同的错误。
Question : Any idea why I get this error and how can we get this working?问题:知道为什么会出现此错误以及我们如何使其正常工作吗?
Bonus question : Is it possible to directly query only a list of upcoming 15 birthdays?奖励问题:是否可以直接查询即将到来的 15 个生日的列表?
Sorry Harold, but unfortunately as the error message says, this is not currently supported.抱歉 Harold,但不幸的是,正如错误消息所述,目前不支持此功能。 Behind the scenes Microsoft Graph is farming out requests for data to multiple services.
在幕后,Microsoft Graph 正在向多个服务发出数据请求。 While Microsoft Graph does support paging within services, it doesn't yet support paging (or expand) across services.
虽然 Microsoft Graph 支持服务内分页,但尚不支持跨服务分页(或扩展)。 This is something that we will be working on, but no ETA yet I'm afraid.
这是我们将要做的事情,但恐怕还没有预计到达时间。
解决方法可能是单独访问该属性: https://graph.microsoft.com/v1.0/users/<id_or_principle_name>/birthday
: https://graph.microsoft.com/v1.0/users/<id_or_principle_name>/birthday
不确定您是否找到了解决方法,但我们所做的(有相同的要求)是我们能够从我们的本地 AD 映射自定义生日属性 -> 使用 DirSync 将其同步到 Azure AD,然后它成为扩展属性供我们取用。
Still waiting for this, however, Microsoft Graph does not support it at the moment.还在等待,但是,Microsoft Graph 目前不支持它。 It is currently in the backlog of Microsoft.
它目前在微软的积压工作中。
In case you are in need of the same functionality, please vote on the Uservoice / ideas pages at:如果您需要相同的功能,请在用户声音/想法页面上投票:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.