Using Microsoft graph API to retrieve a specific attribute

梦想的初衷 提交于 2019-12-07 02:10:27

If you look at the documented properties exposed on a user, you will find there is no property called EmployeeId.

Now it could be that this property exists as an Open Extension on the user object.

In that case you can read here on how to return the extension properties for the user object.

GET /users/{Id|userPrincipalName}/extensions/{extensionId}

Or you could be using Schema Extensions for the same purpose.

GET https://graph.microsoft.com/beta/schemaExtensions

Either way, if you are certian that EmployeeId exists in your directory, you should know it is NOT a default property that is supported by Microsoft Graph or AAD. Instead it must be some extension that was added to your directory with one of the two extension methods above.

I hope this helps.

Artom Harchenko

I guess this thread is pretty outdated. There is now a standard attribute in Azure AD exposed via Microsoft Graph API called "employeeId" as documented on Official GraphAPI reference doc It is not presented in the default response, but can be retrieved by $select argument like: https://graph.microsoft.com/v1.0/users/{user_id}?$select=givenName,surname,employeeId,etc...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!