Reputation: 661
At first I want to mentioned I did search for the answer but I did not get the concrete answer. So here I am asking again.
I am using ASP.NET MVC project and using Microsoft graph to get information from Azure AD. I am trying to get EmployeeId
along with DisplayName
. For the scope I am using user.readbasic.all
.
With below query I am getting DiplayName
for all the users but for EmployeeID
I am getting null. Except for myself.
https://graph.microsoft.com/v1.0/users?$select=DisplayName,EmployeeId
When I use "me" then again get the EmployeeID
.
https://graph.microsoft.com/v1.0/me?$select=DisplayName,EmployeeId
So using the user.readbasic.all
I do get employee id but for myself but why not for others
Upvotes: 1
Views: 3560
Reputation: 4610
This is due to for others Employee ID has not been set.
Example: Employee ID has not been set for a user ,so it is showing null.
Let me Set an employee ID for a user.
Now I am testing for with same API I am getting my EmployeeID value.
In below Picture you can see as I have set EID for Rahul Only and for others it is showing null.
Upvotes: 1