问题
When testing https://graph.microsoft.com/v1.0/users/<my-email>/manager
, I receive the following response (I replaced values with "HIDDEN"):
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects/$entity",
"@odata.type": "#microsoft.graph.user",
"id": HIDDEN,
"businessPhones": [
HIDDEN
],
"displayName": HIDDEN,
"givenName": HIDDEN,
"jobTitle": "Director, Information Technology",
"mail": HIDDEN,
"mobilePhone": HIDDEN,
"officeLocation": HIDDEN,
"preferredLanguage": null,
"surname": HIDDEN,
"userPrincipalName": HIDDEN
}
Clearly it works. But when I try the same URI using $expand
instead, it doesn't show the manager:
URI: https://graph.microsoft.com/v1.0/users/<my-email>?$expand=manager
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"businessPhones": [
HIDDEN
],
"displayName": "Yousef Shanawany",
"givenName": "Yousef",
"jobTitle": "Developer, Application",
"mail": HIDDEN,
"mobilePhone": null,
"officeLocation": "US California San Jose America Center",
"preferredLanguage": null,
"surname": "Shanawany",
"userPrincipalName": HIDDEN,
"id": HIDDEN
}
How can I get my manager using the $expand
parameter in MS Graph?
回答1:
I believe this works in beta today. Try GET https://graph.microsoft.com/beta/me?$expand=manager
来源:https://stackoverflow.com/questions/56365656/expand-manager-does-not-expand-manager