I would like to make this query to the Microsoft Graph API using the Microsoft Graph SDKs. I would like to get all users with the domain in email address is @something.com.
Use of $filter with the endsWith operator
GET ../users?$count=true&$filter=endsWith(mail,'@something.com')
I tried this following line of code :
var users= await _graphServiceClient.Users.Request().Filter("mail '@something.com'").Select(u => new {
u.Mail,
u.DisplayName,
}).GetAsync();
The error I get is :
Microsoft.Graph.ServiceException: 'Code: BadRequest
Message: Invalid filter clause
Without the filter, it works fine. Am I missing something?
Refs: Advanced query : https://docs.microsoft.com/en-us/graph/query-parameters Microsoft Graph SDKs : https://docs.microsoft.com/en-us/graph/sdks/create-requests?tabs=CS