startContactStreaming method
Initiates real-time message streaming for a new chat contact.
For more information about message streaming, see Enable real-time chat message streaming in the Connect Customer Administrator Guide.
For more information about chat, see the following topics in the Connect Customer Administrator Guide:
- Concepts: Web and mobile messaging capabilities in Connect Customer
- Connect Customer Chat security best practices
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
Parameter chatStreamingConfiguration :
The streaming configuration, such as the Amazon SNS streaming endpoint.
Parameter contactId :
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 Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter clientToken :
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.
Implementation
Future<StartContactStreamingResponse> startContactStreaming({
required ChatStreamingConfiguration chatStreamingConfiguration,
required String contactId,
required String instanceId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'ChatStreamingConfiguration': chatStreamingConfiguration,
'ContactId': contactId,
'InstanceId': instanceId,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/contact/start-streaming',
exceptionFnMap: _exceptionFns,
);
return StartContactStreamingResponse.fromJson(response);
}