I am trying to query the Microsoft GRAPH REST API as follows:
https://graph.microsoft.com/beta/auditLogs/signIns$filter=location/any(c:c/countryOrRegion eq 'CA')
However I am receiving a 400: Invalid filter clause error.
If I do a simple query such as $filter=userDisplayName eq 'Bob Smith'
my query works fine.
What is the correct way to filter signIns by Country in Graph?
CodePudding user response:
Syntax for filter sub-property - $filter=property/subProperty eq 'value-to-match'
You can try using below query
https://graph.microsoft.com/beta/auditLogs/signins?$filter=location/countryOrRegion eq 'IN'
For more info you can check the docs for filter query parameters - https://learn.microsoft.com/en-us/graph/filter-query-parameter