쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

Working with Attachments - Amazon Connect
이 페이지는 귀하의 언어로 번역되지 않았습니다. 번역 요청

Working with Attachments

This topic explains how to work with attachments for Chat and Cases in Amazon Connect. For Chat Attachments, refer to the first section on the Amazon Connect Participant Service API. For Case Attachments, refer to the second section on the Amazon Connect service’s Attached Files APIs.

Uploading Attachments with the Participant Service

There are three basic steps for uploading a file using the Amazon Connect Participant Service API.

  1. HTTP POST file metadata to StartAttachmentUpload API, which will provide a signed Amazon S3 URL and attachment ID for uploading the file directly to Amazon S3.

  2. HTTP PUT file data to the signed Amazon S3 URL.

  3. HTTP POST attachment ID to CompleteAttachmentUpload to finalize the upload to Amazon S3.

Below is a basic JavaScript implementation for reference purposes.

//Define the html element for file using input tag <input type="file" id="fileUpload"> <input type="button" id="btnUploadFile" onclick="uploadFile()" value="Upload file"> async function uploadFile() { //Initiate the file upload by calling StartAttachmentUpload, providing the name, size, and content type of the file you want to upload. //The response will include a pre-signed URL and headers to use when building the file upload request, as well as an AttachmentId. const files = document.getElementById('fileUpload').files; const file = files[0]; const startUploadRequest = { AttachmentName: file.name, AttachmentSizeInBytes: file.size, ContentType: file.type }; const { AttachmentId, UploadMetadata } = await startAttachmentUpload(startUploadRequest); //Send the file data to the pre-signed S3 URL. //The file is stored in a temporary location in the S3 bucket. await uploadFileToS3(file, UploadMetadata.Url, UploadMetadata.HeadersToInclude); //Finalize the file upload by calling CompleteAttachmentUpload, providing the AttachmentId. //This moves the file to the final Attachments S3 path configured for the connect instance. const completeUploadRequest = { AttachmentIds: [ AttachmentId ] }; await completeAttachmentUpload(completeUploadRequest); } async function startAttachmentUpload(requestData){ const response = await fetch(StartAttachmentUploadEndpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' 'X-Amz-Bearer': ConnectionToken, }, body: JSON.stringify(requestData) }); return response.data; } async function uploadFileToS3(file, signedUrl, headersToInclude) { return fetch(signedUrl, { method: 'PUT', headers: headersToInclude, body: file }); } async function completeAttachmentUpload(requestData){ return fetch(CompleteAttachmentUploadEndpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' 'X-Amz-Bearer': ConnectionToken, }, body: JSON.stringify(requestData) }); }

For an example of a real world implementation, view the Amazon Connect ChatJS JavaScript client on GitHub.

Uploading Attached Files with the Connect Service

The same basic steps follow from the Participant service instructions, for usage with the Amazon Connect service’s attached file APIs.

  1. Call the StartAttachedFileUpload API with the required attached file information, which will provide a signed Amazon S3 URL, headers, and file ID for uploading the file directly to Amazon S3.

    1. If you are attaching a file to a Case, the calling identity must also have the cases:CreateRelatedItem permission on the target Case resource.

  2. Using your http client of choice, PUT file data to the signed Amazon S3 URL, ensuring that you add the headers as required from the response of Step 1.

  3. Call the CompleteAttachedFileUpload to finalize the upload to Amazon S3.

프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.