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.
To set up this list I need the following properties exposed via the 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:
{
"@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": "[email protected]",
"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
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:
{
"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.
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?
Sorry Harold, but unfortunately as the error message says, this is not currently supported. Behind the scenes Microsoft Graph is farming out requests for data to multiple services. While Microsoft Graph does support paging within services, it doesn't yet support paging (or expand) across services. This is something that we will be working on, but no ETA yet I'm afraid.
workaround could be to access that property separately:
https://graph.microsoft.com/v1.0/users/<id_or_principle_name>/birthday
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With