5
votes

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:

  • id
  • displayName
  • userPrincipalName
  • birthday

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?

4
Are you signing in to Graph Explorer with your personal Microsoft account? - Philippe Signoret
No @PhilippeSignoret, I'm not using my personal Microsoft account. I'm using my Organizational Account (Office 365-account), because I expect to use this functionality from a Organizational, not a consumer perspective. - Harold Van de Kamp

4 Answers

2
votes

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.

2
votes

workaround could be to access that property separately: https://graph.microsoft.com/v1.0/users/<id_or_principle_name>/birthday

0
votes

Not sure if you have found a workaround but what we did (had the same requirement) is we were able to map the custom Birthday attribute from our On-Premise AD -> Sync it to Azure AD using DirSync and it then became an extended property for us to pick up and use.

0
votes