getTranscript method

Future<GetTranscriptResponse> getTranscript({
  1. required String connectionToken,
  2. String? contactId,
  3. int? maxResults,
  4. String? nextToken,
  5. ScanDirection? scanDirection,
  6. SortKey? sortOrder,
  7. StartPosition? startPosition,
})

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
The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter connectionToken : The authentication token associated with the participant's connection.

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

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

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

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

Parameter sortOrder : The sort order for the records. Default: DESCENDING.

Parameter startPosition : A filtering option for where to start.

Implementation

Future<GetTranscriptResponse> getTranscript({
  required String connectionToken,
  String? contactId,
  int? maxResults,
  String? nextToken,
  ScanDirection? scanDirection,
  SortKey? sortOrder,
  StartPosition? startPosition,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  final headers = <String, String>{
    'X-Amz-Bearer': connectionToken.toString(),
  };
  final $payload = <String, dynamic>{
    if (contactId != null) 'ContactId': contactId,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (scanDirection != null) 'ScanDirection': scanDirection.value,
    if (sortOrder != null) 'SortOrder': sortOrder.value,
    if (startPosition != null) 'StartPosition': startPosition,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/participant/transcript',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetTranscriptResponse.fromJson(response);
}