Newer Version Available

This content describes an older version of this product. View Latest

QueryAll More Results

Returns the next set of results from a QueryAll request using a query locator. This API resource executes the specified QueryAll request. QueryAll More Results is available in API version 29.0 and later.

If the number of results from an initial QueryAll request exceeds the 2,000 record limit, the response contains the first set of 2,000 results, a false value for done, and a query locator. Use this query locator in a QueryAll More Results request to retrieve the next set of 2,000 records. If there are still more records to be returned, the response contains a new query locator and done is false. You can continue retrieving results from the initial QueryAll request until done is true, which indicates that all results are returned.

The URI specified in the nextRecordsUrl field of a QueryAll response body contains query instead of queryAll. To retrieve the next set of results, you can use either the Query More Results or the QueryAll More Results resources with the same query locator. The remaining results include deleted records that match the initial query.

For example, if the response body of a QueryAll request contains "nextRecordsUrl": "/services/data/v56.0/query/01g5e00001AH2dOAAT-4000", you can retrieve the next set of QueryAll results with either URI.
  • /services/data/v56.0/query/01g5e00001AH2dOAAT-4000
  • /services/data/v56.0/queryAll/01g5e00001AH2dOAAT-4000

Note

URI
/services/data/vXX.X/queryAll/query_locator
Formats
JSON, XML
HTTP Method
GET
Authentication
Authorization: Bearer token
Parameters
Parameter Description
query_locator A string used to retrieve the next set of query results. If there are more results to be retrieved, the previous set of QueryAll results contains the query locator in the nextRecordsUrl field.
Response body
The response contains the total number of records returned by the QueryAll request (totalSize), a boolean indicating whether there are no more results (done), the URI of the next set of records (nextRecordsUrl), and an array of query result records (records).
Example response body
1{
2  "totalSize": 3222,
3  "done": false,
4  "nextRecordsUrl": "/services/data/v56.0/query/01gRO0000016PIAYA2-500",
5  "records": [
6    {
7      "attributes": {
8        "type": "Contact",
9        "url": "/services/data/v56.0/sobjects/Contact/003RO0000035WQgYAM"
10      },
11      "Id": "003RO0000035WQgYAM",
12      "Name": "John Smith"
13    },
14    ...
15  ]
16}

Resources for Executing SOQL Queries