Skip to content

transfer_contact

transfer_contact(
    instance_id: InstanceId,
    contact_id: ContactId,
    contact_flow_id: ContactFlowId,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    queue_id: Optional[QueueId] = None,
    user_id: Optional[AgentResourceId] = None,
    client_token: Optional[ClientToken] = None,
) -> TransferContactResponse

Transfers TASK or EMAIL contacts from one agent or queue to another agent or queue at any point after a contact is created. You can transfer a contact to another queue by providing the flow which orchestrates the contact to the destination queue. This gives you more control over contact handling and helps you adhere to the service level agreement (SLA) guaranteed to your customers.

Note the following requirements:

  • Transfer is only supported for TASK and EMAIL contacts.

  • Do not use both QueueId and UserId in the same call.

  • The following flow types are supported: Inbound flow, Transfer to agent flow, and Transfer to queue flow.

  • The TransferContact API can be called only on active contacts.

  • A contact cannot be transferred more than 11 times.

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.

  • queue_id (Optional[QueueId], default: None ) –

    The identifier for the queue.

  • user_id (Optional[AgentResourceId], default: None ) –

    The identifier for the user. This can be the ID or the ARN of the user.

  • contact_flow_id (ContactFlowId) –

    The identifier of the flow.

  • 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/connect.py
def transfer_contact(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    contact_id: "capo_connect.types.contact_id.ContactId",
    contact_flow_id: "capo_connect.types.contact_flow_id.ContactFlowId",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    queue_id: Optional["capo_connect.types.queue_id.QueueId"] = None,
    user_id: Optional[
        "capo_connect.types.agent_resource_id.AgentResourceId"
    ] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> "capo_connect.types.transfer_contact_response.TransferContactResponse":
    """<p>Transfers <code>TASK</code> or <code>EMAIL</code> contacts from one agent or queue to another agent or queue at any point after a contact is created. You can transfer a contact to another queue by providing the flow which orchestrates the contact to the destination queue. This gives you more control over contact handling and helps you adhere to the service level agreement (SLA) guaranteed to your customers.</p> <p>Note the following requirements:</p> <ul> <li> <p>Transfer is only supported for <code>TASK</code> and <code>EMAIL</code> contacts.</p> </li> <li> <p>Do not use both <code>QueueId</code> and <code>UserId</code> in the same call.</p> </li> <li> <p>The following flow types are supported: Inbound flow, Transfer to agent flow, and Transfer to queue flow.</p> </li> <li> <p>The <code>TransferContact</code> API can be called only on active contacts.</p> </li> <li> <p>A contact cannot be transferred more than 11 times.</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 in this instance of Connect Customer. </p>
        queue_id: <p>The identifier for the queue.</p>
        user_id: <p>The identifier for the user. This can be the ID or the ARN of the user.</p>
        contact_flow_id: <p>The identifier of the flow.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</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.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.transfer_contact_request.TransferContactRequest]",
    ) -> OperationResponse[
        "capo_connect.types.transfer_contact_response.TransferContactResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.transfer_contact

        output, http_response = (
            capo_connect._operations.amazon_connect_service.transfer_contact.transfer_contact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TransferContact")
    )
    input_: capo_connect.types.transfer_contact_request.TransferContactRequest = {
        "instance_id": instance_id,
        "contact_id": contact_id,
        "contact_flow_id": contact_flow_id,
    }
    if queue_id is not None:
        input_["queue_id"] = queue_id
    if user_id is not None:
        input_["user_id"] = user_id
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output