Salesforce REST API Query More than 2000

driangle picture driangle · May 2, 2012 · Viewed 9.8k times · Source

I'm trying to execute a SOQL query using salesforce REST API which will return 2,749 results. However it seems there is a limit of 2,000 results that can be returned for a given request.

Is there a way to query the remaining 749 results without using the OFFSET keyword? (it's not currently supported in my production environment).

I looked into this and found a queryMore function but I can't find a way to call it through the REST API.

Answer

superfell picture superfell · May 2, 2012

part of the result is a nextRecordsUrl property which when you do a GET on it, will return you the next chunk of the results. See the section on query in the rest api docs.