I'm trying to get a total count of users through Microsoft Graph API through my B2C AAD tenant, but the response seems to either error out or is omitting the @odata.count
property.
Feedback online is also mixed where some people say that $count
is still unsupported even thought the official documentation says that $count
is supported for /users.
https://docs.microsoft.com/en-us/graph/query-parameters#count-parameter
I tried through the graph api online version: https://developer.microsoft.com/en-us/graph/graph-explorer?request=users?$count=true&method=GET&version=v1.0
With this result:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"@odata.count": 31,
"value": [
...
]
}
However doing the same thing through something like postman nets me this result:
GET /v1.0/users?$count=true HTTP/1.1
Host: graph.microsoft.com
Authorization: Bearer [token]
ConsistencyLevel: eventual
{
"error": {
"code": "Request_BadRequest",
"message": "This request is not supported by the service",
"innerError": {
"date": "2020-10-09T18:19:44",
"request-id": "4d97fd77-19ad-42f9-9357-66c24c867ce2",
"client-request-id": "4d97fd77-19ad-42f9-9357-66c24c867ce2"
}
}
}
If I remove ConsistencyLevel
header, I get a valid response but there is no @odata.count
property.
Is there some Graph Api permissions that I am missing, or is this expected?