Forum Discussion
Jeff Walzer
Dec 22, 2022Iron Contributor
How to use multiple filter operations in beta Graph API?
I am trying to run the following API: https://graph.microsoft.com/beta/users?$count=true&$filter=signInActivity/lastSignInDateTime le 2022-09-01T00:00:00Z and endsWith(mail,'@alumni.xxx.xxx') ...
Jeff Walzer
Jan 16, 2023Iron Contributor
I had to add the following to the Request headers:
Key - ConsistencyLevel
Value - eventual
After I added that, I was able to run the search:
https://graph.microsoft.com/beta/users?$count=true&$filter=signInActivity/lastSignInDateTime+le+2022-09-01T00:00:00Z&$filter=endsWith(mail,'@alumni.xxx.xxx')
Mark_Rullo
Jan 17, 2023Copper Contributor
Jeff Walzer thank you for the quick response!
https://graph.microsoft.com/beta/users?$filter=signInActivity/lastSignInDateTime le 2022-07-21T00:00:00Z&$filter=userType eq 'Guest'&$top=30
I tried that and I got this:
{
"error": {
"code": "BadRequest",
"message": "Query option '$filter/filter' was specified more than once, but it must be specified at most once.",
"innerError": {
"date": "2023-01-17T00:45:17",
"request-id": "b1417012-d426-40d4-bc19-d44c07d1fedd",
"client-request-id": "b1417012-d426-40d4-bc19-d44c07d1fedd"
}
}
}