startContactRecording method

Future<void> startContactRecording({
  1. required String contactId,
  2. required String initialContactId,
  3. required String instanceId,
  4. required VoiceRecordingConfiguration voiceRecordingConfiguration,
})

This API starts recording the contact when the agent joins the call. StartContactRecording is a one-time action. For example, if you use StopContactRecording to stop recording an ongoing call, you can't use StartContactRecording to restart it. For scenarios where the recording has started and you want to suspend and resume it, such as when collecting sensitive information (for example, a credit card number), use SuspendContactRecording and ResumeContactRecording.

You can use this API to override the recording behavior configured in the Set recording behavior block.

Only voice recordings are supported at this time.

May throw InvalidRequestException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw InternalServiceException.

Parameter contactId : The identifier of the contact.

Parameter initialContactId : The identifier of the contact. This is the identifier of the contact associated with the first interaction with the contact center.

Parameter instanceId : The identifier of the Amazon Connect instance.

Parameter voiceRecordingConfiguration : Who is being recorded.

Implementation

Future<void> startContactRecording({
  required String contactId,
  required String initialContactId,
  required String instanceId,
  required VoiceRecordingConfiguration voiceRecordingConfiguration,
}) async {
  ArgumentError.checkNotNull(contactId, 'contactId');
  _s.validateStringLength(
    'contactId',
    contactId,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(initialContactId, 'initialContactId');
  _s.validateStringLength(
    'initialContactId',
    initialContactId,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  _s.validateStringLength(
    'instanceId',
    instanceId,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      voiceRecordingConfiguration, 'voiceRecordingConfiguration');
  final $payload = <String, dynamic>{
    'ContactId': contactId,
    'InitialContactId': initialContactId,
    'InstanceId': instanceId,
    'VoiceRecordingConfiguration': voiceRecordingConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/contact/start-recording',
    exceptionFnMap: _exceptionFns,
  );
}