Forum Discussion
John_Lee2025
Dec 26, 2022Copper Contributor
@odata.count does not match actual number of email messages retrieved
I have been using Graph API to read messages from a selected mailbox like below. $url = https://graph.microsoft.com/v1.0/users/email address removed for privacy reasons/messages?filter=((Rec...
VasilMichev
Dec 26, 2022MVP
The @odata.count will reflect the total number of messages within the mailbox, matching the current query, whereas the results you are getting are paginated. Thus @odata.count will always be greater or equal to the actual number of messages within the reply. In effect, it represents the total number of entries you will get after you follow all the nextLink queries.
John_Lee2025
Jan 06, 2023Copper Contributor
Thanks Vasil for your response.
BTW I really appreciate all your contributions to the O365 community.
As far as this thread goes, maybe I did not express myself correctly.
I am aware that @odata.count contains the total number of messages that should be returned.
However, as I fetch each page (usually 10 items except the last fetch) of messages (based on presence of @odata.nextLink, sometimes I found out that the total messages fetched is less than the @odata.count.