Harold Van de Kamp
Harold Van de Kamp

Reputation: 83

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.

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?

Upvotes: 5

Views: 3982

Answers (4)

Harold Van de Kamp
Harold Van de Kamp

Reputation: 83

Still waiting for this, however, Microsoft Graph does not support it at the moment. 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:

Upvotes: 0

wivku
wivku

Reputation: 2653

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

Upvotes: 2

GroFinJarrydP
GroFinJarrydP

Reputation: 11

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.

Upvotes: 0

Dan Kershaw - MSFT
Dan Kershaw - MSFT

Reputation: 5838

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.

Upvotes: 2

Related Questions