Skip to content

start_contact_streaming async

start_contact_streaming(
    instance_id: InstanceId,
    contact_id: ContactId,
    chat_streaming_configuration: ChatStreamingConfiguration,
    client_token: ClientToken,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
) -> StartContactStreamingResponse

Initiates real-time message streaming for a new chat contact.

For more information about message streaming, see Enable real-time chat message streaming in the Connect Customer Administrator Guide.

For more information about chat, see the following topics in the Connect Customer Administrator Guide:

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. This is the identifier of the contact associated with the first interaction with the contact center.

  • chat_streaming_configuration (ChatStreamingConfiguration) –

    The streaming configuration, such as the Amazon SNS streaming endpoint.

  • client_token (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.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def start_contact_streaming(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    contact_id: "capo_connect.types.contact_id.ContactId",
    chat_streaming_configuration: "capo_connect.types.chat_streaming_configuration.ChatStreamingConfiguration",
    client_token: "capo_connect.types.client_token.ClientToken",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
) -> "capo_connect.types.start_contact_streaming_response.StartContactStreamingResponse":
    """<p> Initiates real-time message streaming for a new chat contact.</p> <p> For more information about message streaming, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/chat-message-streaming.html">Enable real-time chat message streaming</a> in the <i>Connect Customer Administrator Guide</i>.</p> <p>For more information about chat, see the following topics in the <i>Connect Customer Administrator Guide</i>: </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/adminguide/web-and-mobile-chat.html">Concepts: Web and mobile messaging capabilities in Connect Customer</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security-best-practices.html#bp-security-chat">Connect Customer Chat security best practices</a> </p> </li> </ul>

    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. This is the identifier of the contact associated with the first interaction with the contact center.</p>
        chat_streaming_configuration: <p>The streaming configuration, such as the Amazon SNS streaming endpoint.</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.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.limit_exceeded_exception.LimitExceededException: <p>The allowed limit for the resource has been exceeded.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</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_streaming_request.StartContactStreamingRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.start_contact_streaming_response.StartContactStreamingResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.start_contact_streaming

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartContactStreaming")
    )
    input_: capo_connect.types.start_contact_streaming_request.StartContactStreamingRequest = {
        "instance_id": instance_id,
        "contact_id": contact_id,
        "chat_streaming_configuration": chat_streaming_configuration,
        "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