Composite Request

Returns a RestRequest object that you then use to execute the composite request.

Regardless of the number of subrequests, each composite request counts as one API call.

Note

Parameters 

  • apiVersion (string)

  • requests

    • iOS

      • requests (array)—Array of subrequests
      • refIds (array)—Array of reference IDs for the requests. The number of elements should match the number of requests.
    • Android

      • refIdToRequests (map)— LinkedHashMap of reference IDs to RestRequest objects. Requests are played in the order in which they’re mapped.
  • allOrNone (Boolean)—Flag that indicates whether to treat all requests as a single transactional block in error conditions.

iOS 

Swift

1RestClient.shared.compositeRequest(requests:refIds:allOrNone:apiVersion:)
Objective-C

1- (SFRestRequest *)compositeRequest:(NSArray<SFRestRequest *> *) requests
2                             refIds:(NSArray<NSString *> *)refIds
3                          allOrNone:(BOOL)allOrNone
4                         apiVersion:(nullable NSString *)apiVersion;

Android 

Kotlin

1@Throws(JSONException::class)
2fun getCompositeRequest(apiVersion: String?, allOrNone: Boolean,
3refIdToRequests: LinkedHashMap<String?, RestRequest?>): CompositeRequest
Java

1public static CompositeRequest getCompositeRequest(String apiVersion,
2    boolean allOrNone, LinkedHashMap<String, RestRequest> refIdToRequests)
3    throws JSONException

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.