completeAttachmentUpload method
Allows you to confirm that the attachment has been uploaded using the pre-signed URL provided in StartAttachmentUpload API. A conflict exception is thrown when an attachment with that identifier is already being uploaded.
For security recommendations, see Connect Customer Chat security best practices. The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter attachmentIds :
A list of unique identifiers for the attachments.
Parameter connectionToken :
The authentication token associated with the participant's connection.
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<void> completeAttachmentUpload({
required List<String> attachmentIds,
required String connectionToken,
String? clientToken,
}) async {
final headers = <String, String>{
'X-Amz-Bearer': connectionToken.toString(),
};
final $payload = <String, dynamic>{
'AttachmentIds': attachmentIds,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/participant/complete-attachment-upload',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}