Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get manager property from a users request

The query https://graph.microsoft.com/v1.0/users?$select=id&$expand=manager does not return any information about manager! (same result using the beta version)

Is there a solution to get the manager navigation property using the graph API ?

like image 504
nlips Avatar asked Apr 10 '17 16:04

nlips


2 Answers

It doesn't appear that this scenario is supported at this time.

You'll have to do more than one call to get the manager property.

1) Get the list of users: https://graph.microsoft.com/v1.0/users

2) Get the manager per each user https://graph.microsoft.com/v1.0/users/f6672f23-134d-47a1-8da8-a0671f3cf3f3/manager

like image 55
Michael Mainer Avatar answered Oct 05 '22 07:10

Michael Mainer


This seems to work fine on the beta endpoint. Try the following example in the Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer:

https://graph.microsoft.com/beta/users?$expand=manager

But some other queries don't work like expected so be careful how you use select:

https://graph.microsoft.com/beta/users?$expand=manager($select=id,displayName)
like image 43
Matija Hanzic Avatar answered Oct 05 '22 06:10

Matija Hanzic