odata.maxpagesize header not working in Microsoft Graph API?

4k views Asked by At

I'm using the Graph Explorer to try out some requests (https://graph.microsoft.com/v1.0/me/events), but my data was too big to easily parse. So I tried to use the Prefer: odata.maxpagesize=3 header as documented, but the response still returned the full list of events. I tried both with v1.0 and beta.

Checking the Network console in Chrome, the Prefer: odata.maxpagesize=3 is included in the request headers, but Preference-Applied is missing from the response headers.

1

There are 1 answers

2
Dmitry On

Try something like this, it definitely works:

https://graph.microsoft.com/v1.0/me/events?$top=3&$skip=3

Paging is achieved by using the $top parameter to specify a page size and the $skip parameter as a multiple of the page size. By incrementing the $skip parameter value by the page size you can request the next page in the set of results.

https://msdn.microsoft.com/office/office365/api/complex-types-for-mail-contacts-calendar#page-results