Microsoft Graph Does Not Return Date Filter Messages

I am trying to execute the following query using microsoft graph:

https://graph.microsoft.com/v1.0/me/messages?$filter=receivedDateTime lt 2016-03-07T16:55:39Z

In this example, I am trying to get all the emails that were received before the delivery date (which is actually today).

However, the Microsoft API returns only one message for this request, which is the first message I have ever received in my account, despite the fact that there are many other letters that meet these criteria. Note that lealso experiencing the same problem.

I assume this is a mistake and I am raising it here for the sake of visibility, but any suggestions for workarounds or problems with my example will be appreciated.

+4
source share
2 answers

I managed to solve this problem by sorting the results using the receiveDateTime DESC method.

Try it, I worked for me:

me/messages?$filter=receivedDateTime lt 2016-03-07T16:55:39Z&$orderby=receivedDateTime desc
+2
source

What you are describing is a known issue. What's happening:

Due to some implementation details, messages, messages, events, contacts, and other types of items can live together in a folder. Since the Messages collection returns only messages, we must skip the other elements. Currently, you will see when you skip items as spaces. A page of 10 elements with less than 10 elements filled in (but still containing @odata.nextLink) is how you identified it.

(, https://graph.microsoft.com/v1.0/me/MailFolders/Inbox/messages), https://graph.microsoft.com/v1.0/me/messages, . , , , .

, , @odata.nextLink, .

+2

All Articles