MS Graph API Get Message List delta Pagination always return maximum 5000 records

Ferdi Rahmadi 6 Reputation points
2021-11-29T07:40:55.337+00:00

When retrieving list email message via delta

"https://graph.microsoft.com/v1.0/users/#{upn}/mailFolders/#{mailFolderId}/messages/delta?$select=id"

we noticed that the items that being returned is limited to 5000 records only. Even though we have more that 5000 records, the delta always stop giving next url link at that point, and gave us the next delta link.

So, i make some experiments and notice few things

  1. When the API request hit from some specific region, it behave differently. In our case, my server is in London region, we hit the API it return 5000 records only. So i tried use the same access token and hit it in different region (SG) it works fine and returning all records. The code, the initial delta link and environment are the same between two different region
  2. We are not using filter, so https://learn.microsoft.com/en-us/graph/delta-query-messages?#use-query-parameters-in-a-delta-query-for-messages its not relevant with our cases
  3. I notice the format of next link url returned from API itself is different. From problematic region, it will return https://graph.microsoft.com/v1.0/users/#{upn}/mailFolders('mailFolderId')/messages/delta?$select=id$skipToken='adsadsadada'. And in non problemation region it will return the same format as initial delta link which is https://graph.microsoft.com/v1.0/users/#{upn}/mailFolders/#{mailFolderId}/messages/delta?$select=id$skipToken='adsadasdasdada'

Please help me to sort it out this issue, because it seems the delta API is not reliable

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,652 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,696 Reputation points Microsoft Vendor
    2022-02-02T14:05:37.053+00:00

    Hi @Ferdi Rahmadi ,

    We have seen similar issue with message delta token with one of our customer and product team issue has resolved.

    Could you please verify.

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments