Newer Version Available

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

QueryAll

This API resource executes the specified SOQL query. Unlike the Query resource, QueryAll returns records that are deleted because of a merge or delete. QueryAll also returns information about archived task and event records. QueryAll is available in API version 29.0 and later.

When a SOQL query is executed, up to 2,000 records can be returned at a time in a synchronous request. If the number of results exceeds this limit, the response contains only the first set of results and a query identifier, contained in the response’snextRecordsUrl field. The identifier can be used in another request to retrieve the next batch of records. Though the nextRecordsUrl has query in the URL, it still provides remaining results from the initial QueryAll request. The remaining results include deleted records that matched the initial query.

URI
/services/data/vXX.X/queryAll/?q=SOQL query
If the initial number of records exceeds the default limit, use the query identifier to retrieve more query results:
/services/data/vXX.X/queryAll/query identifier
Formats
JSON, XML
HTTP Method
GET
Authentication
Authorization: Bearer token
Parameters
Parameter Description
q A SOQL query. To create a valid URI, replace spaces with a plus sign + in the query string. For example: SELECT+Name+FROM+MyObject.

Resources for Executing SOQL Queries