9

The Office 365 Graph API documentation suggests that $filter and $top operations should be supported when used together on a delta query...

https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_messages#track-message-changes-in-a-folder

However, when executing a query that uses both $filter and $top such as this:

https://graph.microsoft.com/beta/me/mailfolders/AAMkADQ3MDg1NWRmLTUxMGQtNDRiMi1iMGE4LTAzMzdjNGRiYTIxNQAuAAAAAADEPuholyn_QpUTcq2qMEH4AQBScDrPb_rMTZOocc5vRCTLAAAAAAEMAAA=/messages/delta?$filter=receivedDateTime%20ge%202017-04-01T00:00:00Z&$top=1000

We find that the $top value is not applied and the default value of 10 results per page is used. However the $filter has been applied correctly.

When testing without the $filter statement, we find the $top value is applied as expected.

Is this a bug in the Graph API or am I misunderstanding something? Thanks in advance.

David de-Vilder
  • 890
  • 1
  • 8
  • 18
  • My main concern is that the "value" in the $filter might not be escaped, or that there may be other escaping issues. Can you post the raw request? Is the $filter working even when $top is included? – piisexactly3 Apr 12 '17 at 13:25
  • I've updated my original post to contain the raw request URL. The $filter is working fine, just the $top value that is not being applied. – David de-Vilder Apr 21 '17 at 09:02
  • I'm wondering if $top=999 would solve the problem. Documentation is kind of confusing on the issue, but 999 seems like the magic number. – piisexactly3 Apr 21 '17 at 13:22
  • Still no luck - I've tried $top=999 and I'm still only getting back 10 items per page – David de-Vilder Apr 24 '17 at 10:34

2 Answers2

1

I could not get output using $top parameter with delta.

But the optional odata.maxpagesize header mentioned in the same doc seems to be working.

You can try adding this to your request headers. Prefer:

odata.maxpagesize=1000
kayess
  • 3,384
  • 9
  • 28
  • 45
0

Was also having issues w/ $top on /messages/delta. Not only does it not work, found $top actually breaks /messages/delta. If using $top on a folder with say 1000 messages in it, /messages/delta will return 10 messages w/ a skip token. Pass that skip token back in, you'll get 0 messages w/ a delta token. Pass that delta token back in and you'll get 0 messages again. Take off the $top in the original call and you'll be able to pagination through all 1000 messages. It seems that $top isn't specifying how many responses to get back but rather how far in the list the API will look.