Skip to content

start_contact_conversational_analytics_job async

start_contact_conversational_analytics_job(
    instance_id: InstanceId,
    contact_id: ContactId,
    analytics_modes: AnalyticsModes,
    analytics_configuration: AnalyticsConfiguration,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> StartContactConversationalAnalyticsJobResponse

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.

A voice recording must already be attached to the contact before calling this API. Use CreateAttachedFile to attach a recording from an S3 source URI.

For example, you can call CreateContact, then CreateAttachedFile, then StartContactConversationalAnalyticsJob to create a contact, attach a recording, and run post-call analytics.

Parameters:

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • contact_id (ContactId) –

    The identifier of the contact in this instance of Connect Customer.

  • analytics_modes (AnalyticsModes) –

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

  • analytics_configuration (AnalyticsConfiguration) –

    The configuration for the conversational analytics job.

  • client_token (Optional[ClientToken], default: None ) –

    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.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def start_contact_conversational_analytics_job(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    contact_id: "capo_connect.types.contact_id.ContactId",
    analytics_modes: "capo_connect.types.analytics_modes.AnalyticsModes",
    analytics_configuration: "capo_connect.types.analytics_configuration.AnalyticsConfiguration",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> "capo_connect.types.start_contact_conversational_analytics_job_response.StartContactConversationalAnalyticsJobResponse":
    """<p>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.</p> <important> <p>A voice recording must already be attached to the contact before calling this API. Use <code>CreateAttachedFile</code> to attach a recording from an S3 source URI.</p> </important> <note> <p>For example, you can call <code>CreateContact</code>, then <code>CreateAttachedFile</code>, then <code>StartContactConversationalAnalyticsJob</code> to create a contact, attach a recording, and run post-call analytics.</p> </note>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        contact_id: <p>The identifier of the contact in this instance of Connect Customer. </p>
        analytics_modes: <p>The analytics modes to run for the contact. Valid values: <code>PostContact</code>.</p>
        analytics_configuration: <p>The configuration for the conversational analytics job.</p>
        client_token: <p>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 <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.idempotency_exception.IdempotencyException: <p>An entity with the same name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.start_contact_conversational_analytics_job_request.StartContactConversationalAnalyticsJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.start_contact_conversational_analytics_job_response.StartContactConversationalAnalyticsJobResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.start_contact_conversational_analytics_job

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.start_contact_conversational_analytics_job.async_start_contact_conversational_analytics_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartContactConversationalAnalyticsJob")
    )
    input_: capo_connect.types.start_contact_conversational_analytics_job_request.StartContactConversationalAnalyticsJobRequest = {
        "instance_id": instance_id,
        "contact_id": contact_id,
        "analytics_modes": analytics_modes,
        "analytics_configuration": analytics_configuration,
    }
    if client_token is not None:
        input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output