question

MichaelMairegger-2494 avatar image
0 Votes"
MichaelMairegger-2494 asked ShwetaChoudhary-8869 answered

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

The first query does not include any @odata.count information, the second does.

https://graph.microsoft.com/v1.0/me/messages?$count=true&$select=id&$top=0
https://graph.microsoft.com/v1.0/me/messages?$count=true&$select=id&$top=1

Possibly related to https://github.com/microsoftgraph/microsoft-graph-docs/issues/10801
Originally asked in https://github.com/microsoftgraph/microsoft-graph-docs/issues/13710

microsoft-graph-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShwetaChoudhary-8869 avatar image
0 Votes"
ShwetaChoudhary-8869 answered

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!


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.