Forum Discussion

namannassa's avatar
namannassa
Copper Contributor
Jul 07, 2022

Graph List Users API Filters

Hi,

 

I am using this API to list the users - https://graph.microsoft.com/v1.0/users

 

I am trying to filter the users using the display name.

https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'Annexus')

 

I tried to use multiple filters together but got an error - https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'AskAthene')&$filter=startswith(displayName,'Annexus')

 

{
    "error": {
        "code""BadRequest",
        "message""Query option '$filter' was specified more than once, but it must be specified at most once.",
        "innerError": {
            "date""2022-07-07T05:32:03",
            "request-id""baff7d09-ae72-42b3-87c7-6fde62020a82",
            "client-request-id""baff7d09-ae72-42b3-87c7-6fde62020a82"
        }
    }
}
 
Is it possible to use multiple values for one filter or do I have to call this API separately for each value I need to filter for ?
 
I need to get all users where display name is in the given list. So, I need to use all names in the list for the filter together.
 
Is this possible ?

2 Replies

Resources