Skip to content

get_transcript async

get_transcript(
    connection_token: ParticipantToken,
    *,
    config_overrides: Optional[AsyncConnectParticipantClientConfig] = None,
    contact_id: Optional[ContactId] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    scan_direction: Optional[ScanDirection] = None,
    sort_order: Optional[SortKey] = None,
    start_position: Optional[StartPosition] = None,
) -> GetTranscriptResponse

Retrieves a transcript of the session, including details about any attachments. For information about accessing past chat contact transcripts for a persistent chat, see Enable persistent chat.

For security recommendations, see Connect Customer Chat security best practices.

If you have a process that consumes events in the transcript of an chat that has ended, note that chat transcripts contain the following event content types if the event has occurred during the chat session:

  • application/vnd.amazonaws.connect.event.participant.invited

  • application/vnd.amazonaws.connect.event.participant.joined

  • application/vnd.amazonaws.connect.event.participant.left

  • application/vnd.amazonaws.connect.event.chat.ended

  • application/vnd.amazonaws.connect.event.transfer.succeeded

  • application/vnd.amazonaws.connect.event.transfer.failed

ConnectionToken is used for invoking this API instead of ParticipantToken.

The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.

Parameters:

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

    The contactId from the current contact chain for which transcript is needed.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in the page. Default: 10.

  • next_token (Optional[NextToken], default: None ) –

    The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.

  • scan_direction (Optional[ScanDirection], default: None ) –

    The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is provided, FORWARD with StartPosition.

  • sort_order (Optional[SortKey], default: None ) –

    The sort order for the records. Default: DESCENDING.

  • start_position (Optional[StartPosition], default: None ) –

    A filtering option for where to start.

  • connection_token (ParticipantToken) –

    The authentication token associated with the participant's connection.

Raises:

Source code in docs_src/capo_connectparticipant/_services/async_connect_participant.py
async def get_transcript(
    self,
    connection_token: "capo_connectparticipant.types.participant_token.ParticipantToken",
    *,
    config_overrides: Optional[AsyncConnectParticipantClientConfig] = None,
    contact_id: Optional[
        "capo_connectparticipant.types.contact_id.ContactId"
    ] = None,
    max_results: Optional[
        "capo_connectparticipant.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_connectparticipant.types.next_token.NextToken"
    ] = None,
    scan_direction: Optional[
        "capo_connectparticipant.types.scan_direction.ScanDirection"
    ] = None,
    sort_order: Optional["capo_connectparticipant.types.sort_key.SortKey"] = None,
    start_position: Optional[
        "capo_connectparticipant.types.start_position.StartPosition"
    ] = None,
) -> "capo_connectparticipant.types.get_transcript_response.GetTranscriptResponse":
    """<p>Retrieves a transcript of the session, including details about any attachments. For information about accessing past chat contact transcripts for a persistent chat, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html">Enable persistent chat</a>. </p> <p>For security recommendations, see <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> <p>If you have a process that consumes events in the transcript of an chat that has ended, note that chat transcripts contain the following event content types if the event has occurred during the chat session:</p> <ul> <li> <p> <code>application/vnd.amazonaws.connect.event.participant.invited</code> </p> </li> <li> <p> <code>application/vnd.amazonaws.connect.event.participant.joined</code> </p> </li> <li> <p> <code>application/vnd.amazonaws.connect.event.participant.left</code> </p> </li> <li> <p> <code>application/vnd.amazonaws.connect.event.chat.ended</code> </p> </li> <li> <p> <code>application/vnd.amazonaws.connect.event.transfer.succeeded</code> </p> </li> <li> <p> <code>application/vnd.amazonaws.connect.event.transfer.failed</code> </p> </li> </ul> <note> <p> <code>ConnectionToken</code> is used for invoking this API instead of <code>ParticipantToken</code>.</p> </note> <p>The Amazon Connect Participant Service APIs do not use <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Signature Version 4 authentication</a>.</p>

    Args:
        contact_id: <p>The contactId from the current contact chain for which transcript is needed.</p>
        max_results: <p>The maximum number of results to return in the page. Default: 10. </p>
        next_token: <p>The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.</p>
        scan_direction: <p>The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is provided, FORWARD with StartPosition. </p>
        sort_order: <p>The sort order for the records. Default: DESCENDING.</p>
        start_position: <p>A filtering option for where to start.</p>
        connection_token: <p>The authentication token associated with the participant's connection.</p>

    Raises:
        capo_connectparticipant.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_connectparticipant.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Amazon Connect service.</p>
        capo_connectparticipant.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_connectparticipant.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by Amazon Connect.</p>
        capo_connectparticipant.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connectparticipant.types.get_transcript_request.GetTranscriptRequest]",
    ) -> AsyncOperationResponse[
        "capo_connectparticipant.types.get_transcript_response.GetTranscriptResponse"
    ]:
        import capo_connectparticipant._operations.amazon_connect_participant_service_lambda.get_transcript

        (
            output,
            http_response,
        ) = await capo_connectparticipant._operations.amazon_connect_participant_service_lambda.get_transcript.async_get_transcript(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTranscript")
    )
    input_: capo_connectparticipant.types.get_transcript_request.GetTranscriptRequest = {
        "connection_token": connection_token
    }
    if contact_id is not None:
        input_["contact_id"] = contact_id
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if scan_direction is not None:
        input_["scan_direction"] = scan_direction
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if start_position is not None:
        input_["start_position"] = start_position

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