Graph API - How can I filter user by more than one identity?

Maluenda Miranda, Cristian G 116 Reputation points
2022-04-28T22:48:07.157+00:00

Hi,
I am trying to filter users by the identity. For one criteria I have no problem:

https://graph.microsoft.com/v1.0/users?$filter=identities/any(c:c/issuer eq 'mytenant.onmicrosoft.com' and c/issuerAssignedId eq 'myuser')

But, I need to search for different prefix, that means for myuser I would like to find the accounts:
* myuser
* prefix01.myuser
* prefix02.myuser

I tried to do something like:

identities/any(c:c/issuer eq 'mytenant.onmicrosoft.com' and (c/issuerAssignedId eq 'myuser' or c/issuerAssignedId eq 'prefix01.myuser'))

But, the query was too complex for the Graph API :(.

Any suggestion beside of execute a request for each criteria?

Thanks,
Cristian.

Microsoft Graph Users API
Microsoft Graph Users API
A Microsoft API that allows you to build compelling app experiences based on users, their relationships with other users and groups, and the resources they access for example their mails, calendars, files, administrative roles, group memberships.
726 questions
Microsoft Graph SDK
Microsoft Graph SDK
A Microsoft software developer kit designed to simplify building high-quality, efficient, and resilient applications that access Microsoft Graph.
882 questions
{count} votes