Retrieve a summary of a batch, including statistics on completed, failed, in-progress, and queued calls. This provides an overview of the batch execution state and individual call session states.
- Endpoint which enables consuming the Voice API globally - Redirected by Sinch to the closest region.https://voice.api.sinch.com/v2/projects/{projectId}/batches/{batchId}
- North America 1 - Easthttps://us1.voice.api.sinch.com/v2/projects/{projectId}/batches/{batchId}
- South America 1 - Easthttps://br1.voice.api.sinch.com/v2/projects/{projectId}/batches/{batchId}
- Europe 1 - Centralhttps://eu1.voice.api.sinch.com/v2/projects/{projectId}/batches/{batchId}
- Asia Pacific 1 - Southeasthttps://sg1.voice.api.sinch.com/v2/projects/{projectId}/batches/{batchId}
- https://au1.voice.api.sinch.comhttps://au1.voice.api.sinch.com/v2/projects/{projectId}/batches/{batchId}
/**
* Sinch Java Snippet
*
* <p>This snippet is available at https://github.com/sinch/sinch-sdk-java
*
* <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details
*/
package voice.v2.batches;
import com.sinch.sdk.SinchClient;
import com.sinch.sdk.domains.voice.api.v2.BatchesService;
import com.sinch.sdk.domains.voice.models.v2.batches.response.BatchSummary;
import com.sinch.sdk.models.Configuration;
import java.util.logging.Logger;
import utils.Settings;
public class Get {
private static final Logger LOGGER = Logger.getLogger(Get.class.getName());
public static void main(String[] args) {
String projectId = Settings.getProjectId().orElse("MY_PROJECT_ID");
String keyId = Settings.getKeyId().orElse("MY_KEY_ID");
String keySecret = Settings.getKeySecret().orElse("MY_KEY_SECRET");
// The ID of the batch to get a summary for
String batchId = "BATCH_ID";
Configuration configuration =
Configuration.builder()
.setProjectId(projectId)
.setKeyId(keyId)
.setKeySecret(keySecret)
.build();
SinchClient client = new SinchClient(configuration);
BatchesService batchesService = client.voice().v2().batches();
LOGGER.info(String.format("Get summary for batch with ID '%s'", batchId));
BatchSummary response = batchesService.get(batchId);
LOGGER.info("Response: " + response);
}
}A batch call summary
Number of call sessions that are queued and waiting to be initiated (not yet in progress).
Number of queued call sessions that were not initiated before the batch TTL (ttlSeconds) elapsed and therefore expired.
Requested maximum call initiation rate, in calls per second (CPS), for this batch. Actual CPS may be lower depending on routing, carrier, and platform capacity, as well as account limitations.
Timestamp (RFC 3339) when the batch finished processing (all call sessions reached a final state). Returns
Omitted if the batch is still in progress or has not completed yet.
Batch time-to-live (TTL) in seconds. The maximum amount of time the platform will keep attempting to start queued call sessions in this batch. When the TTL expires, any call sessions that have not yet been initiated will stop being processed (calls already in progress are not affected).
{ "batchId": "01BX5ZZKBKACTAV9WEVGEMMVRC", "sessionCount": 3, "queued": 1, "inProgress": 1, "completed": 1, "expired": 0, "requestedCps": 10, "ttlSeconds": 3600 }