$count=true does not work with $top=0

Michael Mairegger 1 Reputation point
2021-08-27T06:39:21.913+00:00
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Choudhary 606 Reputation points Microsoft Employee
    2021-08-30T09:44:24.68+00:00

    Thank you for reaching out.

    As per the documentation here, the $top parameter is used to specify the page size of the result set. The minimum value of $top is 1 and the maximum depends on the corresponding API.

    Also as per the query parameter limitation, when using the $count=true query string when querying against directory resources, the @odata.count property will be present only in the first page of the paged data. I think this explains not getting the desired result with $top=0.

    Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.