QConnect / Client / create_message_template_attachment

create_message_template_attachment#

QConnect.Client.create_message_template_attachment(**kwargs)#

Uploads an attachment file to the specified Amazon Q in Connect message template. The name of the message template attachment has to be unique for each message template referenced by the $LATEST qualifier. The body of the attachment file should be encoded using base64 encoding. After the file is uploaded, you can use the pre-signed Amazon S3 URL returned in response to download the uploaded file.

See also: AWS API Documentation

Request Syntax

response = client.create_message_template_attachment(
    body='string',
    clientToken='string',
    contentDisposition='ATTACHMENT',
    knowledgeBaseId='string',
    messageTemplateId='string',
    name='string'
)
Parameters:
  • body (string) –

    [REQUIRED]

    The body of the attachment file being uploaded. It should be encoded using base64 encoding.

  • clientToken (string) – 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.

  • contentDisposition (string) –

    [REQUIRED]

    The presentation information for the attachment file.

  • knowledgeBaseId (string) –

    [REQUIRED]

    The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • messageTemplateId (string) –

    [REQUIRED]

    The identifier of the message template. Can be either the ID or the ARN. It cannot contain any qualifier.

  • name (string) –

    [REQUIRED]

    The name of the attachment file being uploaded. The name should include the file extension.

Return type:

dict

Returns:

Response Syntax

{
    'attachment': {
        'attachmentId': 'string',
        'contentDisposition': 'ATTACHMENT',
        'name': 'string',
        'uploadedTime': datetime(2015, 1, 1),
        'url': 'string',
        'urlExpiry': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • attachment (dict) –

      The message template attachment.

      • attachmentId (string) –

        The identifier of the attachment file.

      • contentDisposition (string) –

        The presentation information for the attachment file.

      • name (string) –

        The name of the attachment file being uploaded. The name should include the file extension.

      • uploadedTime (datetime) –

        The timestamp when the attachment file was uploaded.

      • url (string) –

        A pre-signed Amazon S3 URL that can be used to download the attachment file.

      • urlExpiry (datetime) –

        The expiration time of the pre-signed Amazon S3 URL.

Exceptions