In Microsoft Entra ID, can we have a single API to get user access information either by UPN, user by email and user by other email. Instead of hitting separate API for each.

Ron Weasley 0 Reputation points
2024-06-11T14:07:04.8666667+00:00

In Microsoft Entra ID, we have a separate API to get user access information by UPN, user by email and user by other email.
Check the inputted email address with all 3 APIs to get result from either one of the API.
For each user, hitting either of 3 APIs separately, will lead to performance issue.

User by UPN:

https://graph.microsoft.com/v1.0/users/*** Email address is removed for privacy ***

User by Email address:

https://graph.microsoft.com/v1.0/users?$filter=mail eq '*** Email address is removed for privacy ***'

User by Other email address:

https://graph.microsoft.com/v1.0/users?$filter=otherMails/any(c:c eq '*** Email address is removed for privacy ***')

Instead of hitting all APIs. Can we have a single API to check whether the inputted email address match with either of UPN, email address or other email addresses. If any pls suggest.

Thanks,

Haripriya Jayakumar.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,580 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 23,216 Reputation points Microsoft Employee
    2024-06-11T20:12:23.2033333+00:00

    Hi @Ron Weasley , unfortunately there is no single API in Microsoft Entra ID that can retrieve user access information by checking all three email address fields at once.

    You could use the Microsoft Graph API's batch request feature to send multiple requests in a single HTTP call. You can use this feature to send requests to all three APIs at once and retrieve the user access information for each email address field in a single response.

    Keep in mind that batch requests have some limitations, such as a maximum of 20 requests per batch and a maximum payload size of 4 MB. Additionally, batch requests may not always be faster than sending separate requests, depending on the number of requests and the size of the response.

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James

    0 comments No comments