0

I am using top=500 to display the items from SharePoint using below curl command, but still am getting only 100 rows in the out file:

curl -D ~/header_test.txt --ntlm --request GET --netrc "http://spappfarm.intratest.in/iapps/test_uat/_api/Web/Lists/getByTitle('test%20Class%20list%20FI')/items?$top=500" -o ~/out_test.txt

Can you please suggest how to get more than 100 rows from REST API through curl call?

1 Answer 1

0

You tagged the post under SharePoint Online, but your SharePoint URL seems to indicate an on-prem instance, so it is difficult to guess which version of SharePoint you're using.

In general, you should use $top with $skip together to make multiple calls until you get all the items you need rather than increasing the payload response size as most APIs will be designed to actively throttle and/or deny requests that can negatively impact the service.

Luckily, you don't have to keep track of what page you're on: most REST calls that support pagination will return a node with the URL for the next set of results. It is usually called next under the links node, but yours may be different based on your SharePoint version.

I hope this helps?

1
  • Thanks Hugo , Yes there is another URL in the rel="next" which refers to next set of items in the out file . we are using sharepoint 2013 vesion and we are going to get upgraded version SPSE. does the $top=500 works (means whether it retrieve morethan 100 items to the outfile ) in SPSE version ? As we need to build solution which works for both versions of sharepoint Aug 17, 2022 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.