batchPutContact method
Allows you to create a batch of contacts in Connect Customer. The outbound
campaigns capability ingests dial requests via the PutDialRequestBatch
API. It then uses BatchPutContact to create contacts corresponding to
those dial requests. If agents are available, the dial requests are dialed
out, which results in a voice call. The resulting voice call uses the same
contactId that was created by BatchPutContact.
May throw AccessDeniedException.
May throw IdempotencyException.
May throw InternalServiceException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
Parameter contactDataRequestList :
List of individual contact requests.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services SDK
populates this field. For more information about idempotency, see Making
retries safe with idempotent APIs.
Implementation
Future<BatchPutContactResponse> batchPutContact({
required List<ContactDataRequest> contactDataRequestList,
required String instanceId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'ContactDataRequestList': contactDataRequestList,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/contact/batch/${Uri.encodeComponent(instanceId)}',
exceptionFnMap: _exceptionFns,
);
return BatchPutContactResponse.fromJson(response);
}