Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint 2013 REST API not returning all items for a list

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

like image 769
leopik Avatar asked Sep 26 '14 15:09

leopik


Video Answer


1 Answers

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.

like image 179
Christophe Avatar answered Oct 08 '22 00:10

Christophe