StartAttachedFileUpload - Amazon Connect

StartAttachedFileUpload

Provides a pre-signed Amazon S3 URL in response for uploading your content.

Important

You may only use this API to upload attachments to an Amazon Connect Case or Amazon Connect Email.

Request Syntax

PUT /attached-files/InstanceId?associatedResourceArn=AssociatedResourceArn HTTP/1.1 Content-type: application/json { "ClientToken": "string", "CreatedBy": { ... }, "FileName": "string", "FileSizeInBytes": number, "FileUseCaseType": "string", "Tags": { "string" : "string" }, "UrlExpiryInSeconds": number }

URI Request Parameters

The request uses the following URI parameters.

AssociatedResourceArn

The resource to which the attached file is (being) uploaded to. The supported resources are Cases and Email.

Note

This value must be a valid ARN.

Required: Yes

InstanceId

The unique identifier of the Amazon Connect instance.

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

Request Body

The request accepts the following data in JSON format.

ClientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Type: String

Length Constraints: Maximum length of 500.

Required: No

CreatedBy

Represents the identity that created the file.

Type: CreatedByInfo object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: No

FileName

A case-sensitive name of the attached file being uploaded.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: ^\P{C}*$

Required: Yes

FileSizeInBytes

The size of the attached file in bytes.

Type: Long

Valid Range: Minimum value of 1.

Required: Yes

FileUseCaseType

The use case for the file.

Important

Only ATTACHMENTS are supported.

Type: String

Valid Values: EMAIL_MESSAGE | ATTACHMENT

Required: Yes

Tags

The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^(?!aws:)[\p{L}\p{Z}\p{N}_.:/=+\-@]*$

Value Length Constraints: Maximum length of 256.

Required: No

UrlExpiryInSeconds

Optional override for the expiry of the pre-signed S3 URL in seconds. The default value is 300.

Type: Integer

Valid Range: Minimum value of 5. Maximum value of 300.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "CreatedBy": { ... }, "CreationTime": "string", "FileArn": "string", "FileId": "string", "FileStatus": "string", "UploadUrlMetadata": { "HeadersToInclude": { "string" : "string" }, "Url": "string", "UrlExpiry": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

CreatedBy

Represents the identity that created the file.

Type: CreatedByInfo object

Note: This object is a Union. Only one member of this object can be specified or returned.

CreationTime

The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2024-05-03T02:41:28.172Z.

Type: String

FileArn

The unique identifier of the attached file resource (ARN).

Type: String

FileId

The unique identifier of the attached file resource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

FileStatus

The current status of the attached file.

Type: String

Valid Values: APPROVED | REJECTED | PROCESSING | FAILED

UploadUrlMetadata

Information to be used while uploading the attached file.

Type: UploadUrlMetadata object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

InternalServiceException

Request processing failed because of an error or failure with the service.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

ResourceConflictException

A resource already has that name.

HTTP Status Code: 409

ServiceQuotaExceededException

The service quota has been exceeded.

HTTP Status Code: 402

ThrottlingException

The throttling limit has been exceeded.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: