Support / Client / complete_attachment_upload

complete_attachment_upload

Support.Client.complete_attachment_upload(**kwargs)

Completes an attachment upload that was started with GetAttachmentUploadLinks. After you upload a part of the file to its presigned Amazon S3 URL, call CompleteAttachmentUpload with the partIndex and eTag of that part. You can include one part per call, or multiple parts in a single call. After CompleteAttachmentUpload has been called for every part of the file, the service processes the upload asynchronously. The attachment-ready status might not be reflected immediately. Use DescribeAttachmentUploadStatus to poll for the uploadStatus to become attachment-ready before passing the uploadId to CreateCase or AddCommunicationToCase.

See also: AWS API Documentation

Request Syntax

response = client.complete_attachment_upload(
    uploadId='string',
    completedUploads=[
        {
            'partIndex': 123,
            'eTag': 'string'
        },
    ],
    dryRun=True|False
)
Parameters:
  • uploadId (string) –

    [REQUIRED]

    The identifier associated with the upload to complete.

  • completedUploads (list) –

    [REQUIRED]

    The list of parts being reported as completed in this call. Each entry must contain the partIndex of an uploaded part and the ETag returned by Amazon S3 when that part was uploaded.

    • (dict) –

      Identifies a single uploaded part of a multipart attachment upload. Pass a list of CompletedUpload objects to CompleteAttachmentUpload to finalize the upload.

      • partIndex (integer) – [REQUIRED]

        The index of the uploaded part. This is the same partIndex value returned for the corresponding entry in the uploadUrls field of the GetAttachmentUploadLinks response.

      • eTag (string) – [REQUIRED]

        The ETag returned in the response headers when the part was uploaded to Amazon S3. The ETag value identifies the part contents.

  • dryRun (boolean) – Specifies whether to validate the request without actually completing the upload. When set to true, the request is validated but the upload isn’t finalized, and the operation returns a DryRunOperationException. When omitted or set to false, the request runs normally.

Return type:

dict

Returns:

Response Syntax

{
    'uploadStatus': 'attachment-ready'|'attachment-not-ready'|'failed'
}

Response Structure

  • (dict) –

    • uploadStatus (string) –

      The status of the multipart upload after the operation finalizes the attachment. Valid values: attachment-ready, attachment-not-ready, and failed.

Exceptions

  • Support.Client.exceptions.InternalServerError

  • Support.Client.exceptions.DryRunOperationException

  • Support.Client.exceptions.UploadIdNotFound