QApps / Client / create_presigned_url

create_presigned_url#

QApps.Client.create_presigned_url(**kwargs)#

Creates a presigned URL for an S3 POST operation to upload a file. You can use this URL to set a default file for a FileUploadCard in a Q App definition or to provide a file for a single Q App run. The scope parameter determines how the file will be used, either at the app definition level or the app session level.

See also: AWS API Documentation

Request Syntax

response = client.create_presigned_url(
    instanceId='string',
    cardId='string',
    appId='string',
    fileContentsSha256='string',
    fileName='string',
    scope='APPLICATION'|'SESSION',
    sessionId='string'
)
Parameters:
  • instanceId (string) –

    [REQUIRED]

    The unique identifier of the Amazon Q Business application environment instance.

  • cardId (string) –

    [REQUIRED]

    The unique identifier of the card the file is associated with.

  • appId (string) –

    [REQUIRED]

    The unique identifier of the Q App the file is associated with.

  • fileContentsSha256 (string) –

    [REQUIRED]

    The Base64-encoded SHA-256 digest of the contents of the file to be uploaded.

  • fileName (string) –

    [REQUIRED]

    The name of the file to be uploaded.

  • scope (string) –

    [REQUIRED]

    Whether the file is associated with a Q App definition or a specific Q App session.

  • sessionId (string) – The unique identifier of the Q App session the file is associated with, if applicable.

Return type:

dict

Returns:

Response Syntax

{
    'fileId': 'string',
    'presignedUrl': 'string',
    'presignedUrlFields': {
        'string': 'string'
    },
    'presignedUrlExpiration': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • fileId (string) –

      The unique identifier assigned to the file to be uploaded.

    • presignedUrl (string) –

      The URL for a presigned S3 POST operation used to upload a file.

    • presignedUrlFields (dict) –

      The form fields to include in the presigned S3 POST operation used to upload a file.

      • (string) –

        • (string) –

    • presignedUrlExpiration (datetime) –

      The date and time that the presigned URL will expire in ISO 8601 format.

Exceptions

  • QApps.Client.exceptions.AccessDeniedException

  • QApps.Client.exceptions.ValidationException

  • QApps.Client.exceptions.InternalServerException

  • QApps.Client.exceptions.UnauthorizedException

  • QApps.Client.exceptions.ThrottlingException