Reputation: 458
I'm trying to hit the https://graph.microsoft.com/v1.0/users endpoint and I'm running into a problem with pretty much any combination of $filter and $orderby. The docs about this combination say:
which seems to suggest this is possible. These aren't the real query I'm trying to run but these are the minimum representation. Some examples:
$orderby=displayName&$filter=displayName%20eq%20Miriam
$orderby=displayName&$filter=startswith(displayName,'M')
$orderby=displayName&$filter=startsWith(displayName,'M')&$select=displayName
but I always get the error:
"code": "Request_UnsupportedQuery",
"message": "Sorting not supported for current query."
Am I doing this wrong or is this actually not supported?
Upvotes: 1
Views: 1930
Reputation: 3595
To achieve this, you need to:
Select the beta endpoint
Add $count=true in the QueryString
Add ConsistencyLevel = eventual to the Request headers
In this way you would be able to achieve this and below is the query you can use
https://graph.microsoft.com/beta/users?$count=true&$filter=startswith(displayName,'M')&$orderby=displayName
Note: APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.
Please check this Documentation.
Upvotes: 3