- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
StartAttachedFileUploadCommand
Provides a pre-signed Amazon S3 URL in response for uploading your content.
You may only use this API to upload attachments to an Amazon Connect Case or Amazon Connect Email .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ConnectClient, StartAttachedFileUploadCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, StartAttachedFileUploadCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // StartAttachedFileUploadRequest
ClientToken: "STRING_VALUE",
InstanceId: "STRING_VALUE", // required
FileName: "STRING_VALUE", // required
FileSizeInBytes: Number("long"), // required
UrlExpiryInSeconds: Number("int"),
FileUseCaseType: "EMAIL_MESSAGE" || "ATTACHMENT", // required
AssociatedResourceArn: "STRING_VALUE", // required
CreatedBy: { // CreatedByInfo Union: only one key present
ConnectUserArn: "STRING_VALUE",
AWSIdentityArn: "STRING_VALUE",
},
Tags: { // TagMap
"<keys>": "STRING_VALUE",
},
};
const command = new StartAttachedFileUploadCommand(input);
const response = await client.send(command);
// { // StartAttachedFileUploadResponse
// FileArn: "STRING_VALUE",
// FileId: "STRING_VALUE",
// CreationTime: "STRING_VALUE",
// FileStatus: "APPROVED" || "REJECTED" || "PROCESSING" || "FAILED",
// CreatedBy: { // CreatedByInfo Union: only one key present
// ConnectUserArn: "STRING_VALUE",
// AWSIdentityArn: "STRING_VALUE",
// },
// UploadUrlMetadata: { // UploadUrlMetadata
// Url: "STRING_VALUE",
// UrlExpiry: "STRING_VALUE",
// HeadersToInclude: { // UrlMetadataSignedHeaders
// "<keys>": "STRING_VALUE",
// },
// },
// };
StartAttachedFileUploadCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
AssociatedResourceArn Required | string | undefined | |
FileName Required | string | undefined | A case-sensitive name of the attached file being uploaded. |
FileSizeInBytes Required | number | undefined | The size of the attached file in bytes. |
FileUseCaseType Required | FileUseCaseType | undefined | The use case for the file. Only |
InstanceId Required | string | undefined | The unique identifier of the Amazon Connect instance. |
ClientToken | string | undefined | 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 . |
CreatedBy | CreatedByInfo | undefined | Represents the identity that created the file. |
Tags | Record<string, string> | undefined | The tags used to organize, track, or control access for this resource. For example, |
UrlExpiryInSeconds | number | undefined | Optional override for the expiry of the pre-signed S3 URL in seconds. The default value is 300. |
StartAttachedFileUploadCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
CreatedBy | CreatedByInfo | undefined | Represents the identity that created the file. |
CreationTime | string | undefined | The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: |
FileArn | string | undefined | The unique identifier of the attached file resource (ARN). |
FileId | string | undefined | The unique identifier of the attached file resource. |
FileStatus | FileStatusType | undefined | The current status of the attached file. |
UploadUrlMetadata | UploadUrlMetadata | undefined | The headers to be provided while uploading the file to the URL. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient permissions to perform this action. |
InternalServiceException | server | Request processing failed because of an error or failure with the service. |
InvalidRequestException | client | The request is not valid. |
ResourceConflictException | client | A resource already has that name. |
ServiceQuotaExceededException | client | The service quota has been exceeded. |
ThrottlingException | client | The throttling limit has been exceeded. |
ConnectServiceException | Base exception class for all service exceptions from Connect service. |