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. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

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 {
  ArgumentError.checkNotNull(connectionToken, 'connectionToken');
  _s.validateStringLength(
    'connectionToken',
    connectionToken,
    1,
    1000,
    isRequired: true,
  );
  _s.validateStringLength(
    'contactId',
    contactId,
    1,
    256,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1000,
  );
  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.toValue(),
    if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
    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);
}