'Microsoft Graph user endpoint does not return otherMails-property
I'm trying to get the property otherMails when searching for users like this:
https://graph.microsoft.com/v1.0/users?$filter=startswith(givenName, 'anna')&$select=displayName,otherMails
However, the response does not contain otherMails:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(displayName,otherMails)",
"value": [
{
"displayName": "Anna Karenina",
"otherMails": []
}
]
}
The user has the property set in Azure AD:
What am I doing wrong? According to the documentation, this property should be returned on $select: https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0
A list of additional email addresses for the user; for example: ["[email protected]", "[email protected]"]. NOTE: This property cannot contain accent characters. Returned only on $select. Supports $filter (eq, not, ge, le, in, startsWith).
Solution 1:[1]
To be able to read otherMails you need to add User.Read.All permission which allows the app to read the full set of profile properties, reports, and managers of other users.
Resources:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | user2250152 |

