Provides a pre-signed URL for download of a completed attachment. This is an asynchronous API for use with active contacts.
For security recommendations, see Connect Customer Chat security best practices.
-
The participant role CUSTOM_BOT is not permitted to access attachments customers may upload. An AccessDeniedException can indicate that the participant may be a CUSTOM_BOT, and it doesn't have access to attachments.
-
ConnectionToken is used for invoking this API instead of ParticipantToken.
The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
Parameters:
-
attachment_id
(ArtifactId)
–
A unique identifier for the attachment.
-
connection_token
(ParticipantToken)
–
The authentication token associated with the participant's connection.
-
url_expiry_in_seconds
(Optional[URLExpiryInSeconds], default:
None
)
–
The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.
Raises:
Source code in docs_src/capo_connectparticipant/_services/async_connect_participant.py
| async def get_attachment(
self,
attachment_id: "capo_connectparticipant.types.artifact_id.ArtifactId",
connection_token: "capo_connectparticipant.types.participant_token.ParticipantToken",
*,
config_overrides: Optional[AsyncConnectParticipantClientConfig] = None,
url_expiry_in_seconds: Optional[
"capo_connectparticipant.types.url_expiry_in_seconds.URLExpiryInSeconds"
] = None,
) -> "capo_connectparticipant.types.get_attachment_response.GetAttachmentResponse":
"""<p>Provides a pre-signed URL for download of a completed attachment. This is an asynchronous API for use with active contacts.</p> <p>For security recommendations, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security-best-practices.html#bp-security-chat">Connect Customer Chat security best practices</a>. </p> <note> <ul> <li> <p>The participant role <code>CUSTOM_BOT</code> is not permitted to access attachments customers may upload. An <code>AccessDeniedException</code> can indicate that the participant may be a CUSTOM_BOT, and it doesn't have access to attachments.</p> </li> <li> <p> <code>ConnectionToken</code> is used for invoking this API instead of <code>ParticipantToken</code>.</p> </li> </ul> </note> <p>The Amazon Connect Participant Service APIs do not use <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Signature Version 4 authentication</a>.</p>
Args:
attachment_id: <p>A unique identifier for the attachment.</p>
connection_token: <p>The authentication token associated with the participant's connection.</p>
url_expiry_in_seconds: <p>The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.</p>
Raises:
capo_connectparticipant.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_connectparticipant.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Amazon Connect service.</p>
capo_connectparticipant.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_connectparticipant.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by Amazon Connect.</p>
capo_connectparticipant.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_connectparticipant.types.get_attachment_request.GetAttachmentRequest]",
) -> AsyncOperationResponse[
"capo_connectparticipant.types.get_attachment_response.GetAttachmentResponse"
]:
import capo_connectparticipant._operations.amazon_connect_participant_service_lambda.get_attachment
(
output,
http_response,
) = await capo_connectparticipant._operations.amazon_connect_participant_service_lambda.get_attachment.async_get_attachment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetAttachment")
)
input_: capo_connectparticipant.types.get_attachment_request.GetAttachmentRequest = {
"attachment_id": attachment_id,
"connection_token": connection_token,
}
if url_expiry_in_seconds is not None:
input_["url_expiry_in_seconds"] = url_expiry_in_seconds
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|