Used to make a bunch of HTTP Requests as a batch. Currently the number of requests that can be batched at once is capped at 20 by the API layer. Also there are certain requests which cannot be performed by Batch API. Check API documentation for more information.
The request itself is a BoxJSONRequest but extends it to provide additional functionality for aggregating a bunch of requests and responding with multiple responses as if the requests were called individually
@Deprecated public class BatchAPIRequest extends BoxJSONRequest
BoxAPIRequest.RequestHeader
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
BATCH_URL_TEMPLATE
Deprecated.
Batch URL Template.
|
Constructor and Description |
---|
BatchAPIRequest(BoxAPIConnection api)
Deprecated.
As of 2.39.0, BatchAPI Request will no longer be supported.
Constructs an authenticated BatchRequest using a provided BoxAPIConnection. |
Modifier and Type | Method and Description |
---|---|
List<BoxAPIResponse> |
execute(List<BoxAPIRequest> requests)
Deprecated.
As of 2.39.0, BatchAPI Request will no longer be supported.
Execute a set of API calls as batch request. |
protected List<BoxAPIResponse> |
parseResponse(BoxJSONResponse batchResponse)
Deprecated.
As of 2.39.0, BatchAPI Request will no longer be supported.
Parses btch api response to create a list of BoxAPIResponse objects. |
protected void |
prepareRequest(List<BoxAPIRequest> requests)
Deprecated.
As of 2.39.0, BatchAPI Request will no longer be supported.
Prepare a batch api request using list of individual reuests. |
bodyToString, getBodyAsJsonObject, getBodyAsJsonValue, setBody, setBody
addHeader, getBody, getConnectTimeout, getHeaders, getMethod, getReadTimeout, getUrl, isRequestRetryable, isResponseRetryable, resetBody, send, send, sendWithoutRetry, setBody, setBody, setConnectTimeout, setFollowRedirects, setReadTimeout, toString, writeBody
public static final URLTemplate BATCH_URL_TEMPLATE
@Deprecated public BatchAPIRequest(BoxAPIConnection api)
Constructs an authenticated BatchRequest using a provided BoxAPIConnection.
api
- an API connection for authenticating the request.@Deprecated public List<BoxAPIResponse> execute(List<BoxAPIRequest> requests)
Execute a set of API calls as batch request.
requests
- list of api requests that has to be executed in batch.@Deprecated protected void prepareRequest(List<BoxAPIRequest> requests)
Prepare a batch api request using list of individual reuests.
requests
- list of api requests that has to be executed in batch.@Deprecated protected List<BoxAPIResponse> parseResponse(BoxJSONResponse batchResponse)
Parses btch api response to create a list of BoxAPIResponse objects.
batchResponse
- response of a batch api request