Get Details of User of Azue Active Directory using Graph API

1.1k Views Asked by At

enter image description here

I have queried the user endpoint using advanced query capabilities. but I didn't get the value of Department field.

This is my query:

https://graph.microsoft.com/v1.0/users?$count=true&$search="displayName:tobias"&ConsistencyLevel=eventual&$select=employeeId,department,jobTitle

The above query shows all info of the user except the info of block of job information.

Using select query for the user above:

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(employeeId,department,jobTitle)",
"@odata.count": 1,
"value": [
    {
        "employeeId": null,
        "department": null,
        "jobTitle": null
    }
  ]
}

What is the problem about?

1

There are 1 best solutions below

6
Rukmini On

Please note that, getting the details of user from Microsoft Graph API returns only few details/properties by default.

Please refer this MsDoc which confirms the same.

Please use $select to select the job details of the user like below:

https://graph.microsoft.com/v1.0/users?$select=employeeId,department,jobTitle

enter image description here

Reference:

How do I retrieve Job Info from Azure AD via MS Graph by DerDani81