Skip to content

start_web_rtc_contact async

start_web_rtc_contact(
    contact_flow_id: ContactFlowId,
    instance_id: InstanceId,
    participant_details: ParticipantDetails,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    attributes: Optional[Attributes] = None,
    client_token: Optional[ClientToken] = None,
    allowed_capabilities: Optional[AllowedCapabilities] = None,
    related_contact_id: Optional[ContactId] = None,
    references: Optional[ContactReferences] = None,
    description: Optional[Description] = None,
    segment_attributes: Optional[SegmentAttributes] = None,
) -> StartWebRTCContactResponse

Places an inbound in-app, web, or video call to a contact, and then initiates the flow. It performs the actions in the flow that are specified (in ContactFlowId) and present in the Connect Customer instance (specified as InstanceId).

Parameters:

  • attributes (Optional[Attributes], default: None ) –

    A custom key-value pair using an attribute map. The attributes are standard Connect Customer attributes, and can be accessed in flows just like any other contact attributes.

    There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, -, and _ characters.

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

    The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.

  • contact_flow_id (ContactFlowId) –

    The identifier of the flow for the call. To see the ContactFlowId in the Connect Customer admin website, on the navigation menu go to Routing, Flows. Choose the flow. On the flow page, under the name of the flow, choose Show additional flow information. The ContactFlowId is the last part of the ARN, shown here in bold:

    arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx

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

  • allowed_capabilities (Optional[AllowedCapabilities], default: None ) –

    Information about the video sharing capabilities of the participants (customer, agent).

  • related_contact_id (Optional[ContactId], default: None ) –

    The unique identifier for an Connect Customer contact. This identifier is related to the contact starting.

  • references (Optional[ContactReferences], default: None ) –

    A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following reference types at the time of creation: URL | NUMBER | STRING | DATE | EMAIL. ATTACHMENT is not a supported reference type during task creation.

  • description (Optional[Description], default: None ) –

    A description of the task that is shown to an agent in the Contact Control Panel (CCP).

  • segment_attributes (Optional[SegmentAttributes], default: None ) –

    A map of system-defined attributes for the WebRTC contact segment. Use the connect:Subtype attribute to specify the channel subtype, such as connect:WebRTC.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def start_web_rtc_contact(
    self,
    contact_flow_id: "capo_connect.types.contact_flow_id.ContactFlowId",
    instance_id: "capo_connect.types.instance_id.InstanceId",
    participant_details: "capo_connect.types.participant_details.ParticipantDetails",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    attributes: Optional["capo_connect.types.attributes.Attributes"] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
    allowed_capabilities: Optional[
        "capo_connect.types.allowed_capabilities.AllowedCapabilities"
    ] = None,
    related_contact_id: Optional["capo_connect.types.contact_id.ContactId"] = None,
    references: Optional[
        "capo_connect.types.contact_references.ContactReferences"
    ] = None,
    description: Optional["capo_connect.types.description.Description"] = None,
    segment_attributes: Optional[
        "capo_connect.types.segment_attributes.SegmentAttributes"
    ] = None,
) -> "capo_connect.types.start_web_rtc_contact_response.StartWebRTCContactResponse":
    """<p>Places an inbound in-app, web, or video call to a contact, and then initiates the flow. It performs the actions in the flow that are specified (in ContactFlowId) and present in the Connect Customer instance (specified as InstanceId).</p>

    Args:
        attributes: <p>A custom key-value pair using an attribute map. The attributes are standard Connect Customer attributes, and can be accessed in flows just like any other contact attributes.</p> <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, -, and _ characters.</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> <p>The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
        contact_flow_id: <p>The identifier of the flow for the call. To see the ContactFlowId in the Connect Customer admin website, on the navigation menu go to <b>Routing</b>, <b>Flows</b>. Choose the flow. On the flow page, under the name of the flow, choose <b>Show additional flow information</b>. The ContactFlowId is the last part of the ARN, shown here in bold: </p> <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b> </p>
        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>
        allowed_capabilities: <p>Information about the video sharing capabilities of the participants (customer, agent).</p>
        related_contact_id: <p>The unique identifier for an Connect Customer contact. This identifier is related to the contact starting.</p>
        references: <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following reference types at the time of creation: <code>URL</code> | <code>NUMBER</code> | <code>STRING</code> | <code>DATE</code> | <code>EMAIL</code>. <code>ATTACHMENT</code> is not a supported reference type during task creation.</p>
        description: <p>A description of the task that is shown to an agent in the Contact Control Panel (CCP).</p>
        segment_attributes: <p>A map of system-defined attributes for the WebRTC contact segment. Use the <code>connect:Subtype</code> attribute to specify the channel subtype, such as <code>connect:WebRTC</code>.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</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_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_web_rtc_contact_request.StartWebRTCContactRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.start_web_rtc_contact_response.StartWebRTCContactResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.start_web_rtc_contact

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

    def _redact_input(
        input_: "capo_connect.types.start_web_rtc_contact_request.StartWebRTCContactRequest",
    ) -> dict[str, Any]:
        import capo_connect.types.start_web_rtc_contact_request

        return capo_connect.types.start_web_rtc_contact_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_connect.types.start_web_rtc_contact_response.StartWebRTCContactResponse",
    ) -> dict[str, Any]:
        import capo_connect.types.start_web_rtc_contact_response

        return capo_connect.types.start_web_rtc_contact_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartWebRTCContact",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_connect.types.start_web_rtc_contact_request.StartWebRTCContactRequest = {
        "contact_flow_id": contact_flow_id,
        "instance_id": instance_id,
        "participant_details": participant_details,
    }
    if attributes is not None:
        input_["attributes"] = attributes
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if allowed_capabilities is not None:
        input_["allowed_capabilities"] = allowed_capabilities
    if related_contact_id is not None:
        input_["related_contact_id"] = related_contact_id
    if references is not None:
        input_["references"] = references
    if description is not None:
        input_["description"] = description
    if segment_attributes is not None:
        input_["segment_attributes"] = segment_attributes

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