如何使用 Microsoft graph 统计用户数量?

Guy*_*lul 6 microsoft-graph-api

根据文档https://learn.microsoft.com/en-us/graph/query-parameters?#count-parameter我应该能够使用https://graph.microsoft.com/beta/ 获取计数 users?count=true 但它不起作用...另外我发现,如果我将 ConsistencyLevel: eventual 添加到请求标头中,我确实会得到一个计数,但它不在文档中,所以我不确定该计数是真实的用户数

我错过了什么吗?

小智 6

  GET https://graph.microsoft.com/beta/users?$search="displayName:wa"&$orderby=displayName&$count=true
    ConsistencyLevel: eventual
Run Code Online (Sandbox Code Playgroud)

请参考这个文档,它告诉我们需要使用 ConsistencyLevel: eventual

另请参阅这篇关于$count参数的文章:

https://learn.microsoft.com/en-us/graph/query-parameters?tabs=http#count-parameter