SOQL Query

Executes the given SOQL query and returns the requested fields of records that satisfy the query.

The batchSize parameter can range from 200 to 2,000 (default value) and is not guaranteed to be the actual size at runtime. By default, returns up to 2,000 records at once. If you specify a batch size, this request returns records in batches up to that size. Specifying a batch size does not guarantee that the returned batch is the requested size.

Parameters 

  • API version (string, optional)
  • Query (string)
  • Batch size (integer)

iOS 

Swift

1RestClient.shared.request(forQuery:apiVersion:batchSize:)
Objective-C

1- (SFRestRequest *)requestForQuery:(NSString *)soql
2                        apiVersion:(nullable NSString *)apiVersion
3                         batchSize:(NSInteger)batchSize;

Android 

Kotlin

1@Throws(UnsupportedEncodingException::class)
2fun getRequestForQuery(apiVersion: String?, q: String?): RestRequest
Java

1public static RestRequest
2    getRequestForQuery(String apiVersion, String q)
3    throws UnsupportedEncodingException
4
5public static RestRequest
6    getRequestForQuery(String apiVersion, String q, int batchSize)
7    throws UnsupportedEncodingException

See Also 

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.