Sharepoint 2013 REST API not returning all items for a list

leopik picture leopik · Sep 26, 2014 · Viewed 34k times · Source

The title states my problem quite exactly. If I try to gather all 400+ items from a list using sharepoint's REST API, I only get first 100.

I have read http://msdn.microsoft.com/en-us/library/office/dn292552(v=office.15).aspx and in the "Working with list items by using REST" part, they're stating that

The following example shows how to retrieve all of a list’s items.

url: http://site url/_api/web/lists/GetByTitle(‘Test')/items

method: GET

headers: ...

I have highlighted word all, because that's not what I'm getting ...

Am I missing something? Is there some option I should disable/enable to gett truly all items?

Thanks

Answer

Christophe picture Christophe · Sep 26, 2014

The limitation is due to server side paging.

A workaround is to retrieve 100 items at a time, or override the limitation by entering a count of items:

https://$DOMAIN/$SITE/_api/web/Lists/getByTitle('$LIST')/Items?$top=1000

Note that there is also a threshold at 5000.