Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Office 365 Graph API $top not being honoured on delta queries

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.

like image 549
David de-Vilder Avatar asked Apr 10 '17 12:04

David de-Vilder


People also ask

Is Microsoft Graph API a REST API?

The Microsoft Graph API is a RESTful web API that enables you to access Microsoft Cloud service resources. After you register your app and get authentication tokens for a user or service, you can make requests to the Microsoft Graph API.


1 Answers

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
like image 105
Rahul Kumar Avatar answered Sep 22 '22 04:09

Rahul Kumar