startContactConversationalAnalyticsJob method

Future<StartContactConversationalAnalyticsJobResponse> startContactConversationalAnalyticsJob({
  1. required AnalyticsConfiguration analyticsConfiguration,
  2. required List<AnalyticsMode> analyticsModes,
  3. required String contactId,
  4. required String instanceId,
  5. String? clientToken,
})

Starts a Contact Lens post-call analytics job for the specified contact. This API runs Conversational Analytics post-contact analysis on a voice recording that is already attached to the contact, generating transcription, sentiment analysis, redaction, and summarization results based on the provided configuration.

May throw AccessDeniedException. May throw IdempotencyException. May throw InternalServiceException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter analyticsConfiguration : The configuration for the conversational analytics job.

Parameter analyticsModes : The analytics modes to run for the contact. Valid values: PostContact.

Parameter contactId : The identifier of the contact in this instance of Connect Customer.

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<StartContactConversationalAnalyticsJobResponse>
    startContactConversationalAnalyticsJob({
  required AnalyticsConfiguration analyticsConfiguration,
  required List<AnalyticsMode> analyticsModes,
  required String contactId,
  required String instanceId,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'AnalyticsConfiguration': analyticsConfiguration,
    'AnalyticsModes': analyticsModes.map((e) => e.value).toList(),
    if (clientToken != null) 'ClientToken': clientToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/contact/start-conversational-analytics-job/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}',
    exceptionFnMap: _exceptionFns,
  );
  return StartContactConversationalAnalyticsJobResponse.fromJson(response);
}