You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As per microsoft documentation following this link, I am able to make queries about users for my tenant. When using the $search parameter, we are specified to use the ConsistencyLevel=eventual header for it to work (and adviced to use $count=true for some cases). This works as expected when making an HTTP request against the API. However, if I use the $expand parameter to get the users manager, I get an error "Request with $search query parameter only works through MSGraph with a special request header: 'ConsistencyLevel: eventual'", but this is not the case at all.
For example, the next request works just fine. I get the expected HTTP 200 result
GET https://graph.microsoft.com/v1.0/users?$filter=userType eq 'guest'&$search="displayName:jua"ConsistencyLevel: eventual
Whereas the next one does not work
GET https://graph.microsoft.com/v1.0/users?$select=id,displayName,manager&$filter=userType eq 'guest'&$search="displayName:jua"&$expand=manager&$count=true ConsistencyLevel: eventual
I get an HTTP 400 response
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Request with $search query parameter only works through MSGraph with a special request header: 'ConsistencyLevel: eventual'",
"innerError": {
"date": "2023-10-20T20:39:09",
"request-id": "b39648ff-4c5b-4543-8059-845688f86b1d",
"client-request-id": "1466b344-12f4-cf07-be3c-2a2b99ed5917"
}
}
}
Nonetheless, this does not work using the Microsoft.Graph package for .NET (version 5.31.0) even, which is actually where I found the bug and is my biggest concern. I am using .NET 7.
To Reproduce
Steps to reproduce the behavior in .NET application:
Microsoft.Graph.Models.ODataErrors.ODataError: Request with $search query parameter only works through MSGraph with a special
request header: 'ConsistencyLevel: eventual'
Expected behavior
I can make a call to microsoft graph either using an HTTP request or the .NET package to retrieve specific users, using a $search query parameter in combination with the $expand parameter to also get their manager.
Package Version
5.31.0.
Desktop (please complete the following information):
OS: Windows 11
Browser: microsoft edge
Version: 118.0.2088.57
The text was updated successfully, but these errors were encountered:
The code snippet constructed looks correct. However, it seems due to a current API limitation, it is currently not possible to use the $expand parameter combined with the advanced queries on Microsoft Entra ID objects. You can find more information in the documentation below. Removing the $expand should result in a successful response.
I hope in the future we get access to combine these parameters then! Removing the $expand does work, so I guess I'll have to make a second call to get the manager field for every user and make a join-like operation. I would be great if the error we get was more in the lines of "query not supported" instead of pointing to a missing header.
We'll close this for now as there is nothing SDK related to resolve. Incase of any API related questions/issues, you can always create a question at the link below.
Describe the bug
As per microsoft documentation following this link, I am able to make queries about users for my tenant. When using the
$search
parameter, we are specified to use theConsistencyLevel=eventual
header for it to work (and adviced to use$count=true
for some cases). This works as expected when making an HTTP request against the API. However, if I use the$expand
parameter to get the users manager, I get an error"Request with $search query parameter only works through MSGraph with a special request header: 'ConsistencyLevel: eventual'"
, but this is not the case at all.For example, the next request works just fine. I get the expected HTTP 200 result
Whereas the next one does not work
I get an HTTP 400 response
Nonetheless, this does not work using the Microsoft.Graph package for .NET (version 5.31.0) even, which is actually where I found the bug and is my biggest concern. I am using .NET 7.
To Reproduce
Steps to reproduce the behavior in .NET application:
Expected behavior
I can make a call to microsoft graph either using an HTTP request or the .NET package to retrieve specific users, using a $search query parameter in combination with the $expand parameter to also get their manager.
Package Version
5.31.0.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: