3

We are syncing user's Outlook accounts by paginating through the /me/messages endpoint in chronological order. Sometimes the API response will not include @odata:nextLink even if there are more messages.

We are just using the $top, $select, $skip, and $orderby parameters.

For example, one account was paginated up to about 25,000 emails and then there was no nextLink but the emails returned were over 6 months old so it was clear there were more emails since it is an active account. When I changed the $skip parameter to a higher number the API showed newer emails and then correctly returned a nextLink in the response.

Also we have the $top set to 100 but in the response missing a nextLink only 19 emails were returned (despite the emails being returned being over 6 months old and there being many newer emails), so there is some sort of gap in the messages being returned.

Calling the URL https://graph.microsoft.com/v1.0/me/messages?$top=100&$select=id,receivedDateTime,subject,bodyPreview,from,toRecipients,isDraft,sender&$skip=23352&$orderby=receivedDateTime asc returns 19 emails from 2017-06-16 and there is no nextLink in the response.

Calling the same URL but with $skip=24352 (skipping 1,000 ahead) returns 100 emails from 2017-06-17 to 2017-06-20 and has a nextLink in the response so it is clear there actually were more emails and a nextLink should have been present in the first response.

Please let me know if I am doing something wrong or if there is a way we can work around this, thank you!

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • Some relevant code might help with context here. –  Jan 19 '18 at 19:07
  • 1
    @jdv The Microsoft Graph API is a language agnostic REST API so I didn't feel that code would really be helpful in this situation – Connor Smith Jan 20 '18 at 20:42
  • That may be, but unless you are coding to this API with a specific language then this question is probably off-topic. I mean, you have to hit the endpoints with something, and this something is going to drive results (or errors) and contextual information for this specific question. Without code to stare at you are not going to get much activity on this question. –  Jan 22 '18 at 16:09
  • 1
    @jdv I provided the URL in question that is causing the issue and I feel like providing code would just add another layer where something could be going wrong and make this look like a language-specific question when it is general to the API. We are using Python but no matter what language you use to call the API you are going to hit the same issue. I'm pretty confident this is an issue on Microsoft's end – Connor Smith Jan 22 '18 at 18:27
  • You should probably take it up with Microsoft, then. Without an [MCVE](https://stackoverflow.com/help/mcve) you aren't going to get many bites. Questions should be as standalone as possible; a dependency on a link that depends on an auth token is not going to be useful Q&A for others in the future. –  Jan 22 '18 at 19:14
  • API questions are always tricky because they depend on a lot of outside information. That being said, here is a relevant link: https://stackoverflow.com/q/41280125/1531971 –  Jan 22 '18 at 19:22
  • @jdv If you look at the Microsoft Graph API's support page the only options are to post a StackOverflow question or a Github issue. I've done both as I assumed Microsoft employees monitor this and/or somebody else has had the same issue and there is a workaround. That question you linked to isn't really helpful. I know how to use the `@odata:nextLink parameter` - the issue is that sometimes it erroneously is not returned. – Connor Smith Jan 23 '18 at 00:46
  • Corps use SO this way but there is no guarantee anyone is looking. I feel it is a mistake for large corps to (ab)use SO like this. e.g.: https://meta.stackoverflow.com/questions/255745/why-were-not-customer-support-for-your-favorite-company and https://stackoverflow.com/help/product-support (Except there is no way to make sure someone is actually monitoring tagged questions.) None of this matters to _you_ I'm sure, but it will explain why you are not going to get much action associated with this question. SO is a _terrible_ product support site. Maybe push harder on Github? –  Jan 23 '18 at 15:04
  • Looking at the questions tagged "microsoft-graph" there might be a place for you to start sorting this out on your own. Many of the endpoints and responses are not mail specific, and people are reporting how things like `nextLink` are or are not not being returned, and how to use it under various circumstances. Assume Microsoft will not help you... –  Jan 23 '18 at 15:08
  • @jdv I know when it is and isn't supposed to be returned and how to use it. The point is that it is supposed to be returned in this situation but it isn't. Other questions where people are confused what to do with the response or are not sure why it isn't being returned (when it isn't supposed to be returned) isn't going to help too much. I agree that this site isn't the best place for this type of question but my hope was that it was being monitored by Microsoft employees. The Github repo also isn't ideal because it is supposed to be for the docs but it also turned into a support site. – Connor Smith Jan 23 '18 at 22:03

0 Answers0