GetAttachmentUploadLinks
Returns one or more presigned upload URLs for uploading a large file attachment to a
support case by using a multipart upload workflow. The maximum file size that you can upload
with this workflow is 150 MB, and parts can be up to 100 MB each. Initiate a new upload by
providing fileName and fileSizeBytes; the response returns a unique
uploadId, the part size, the total number of parts, and a list of presigned
upload URLs for the requested range of parts. A maximum of 10 upload URLs are returned per
call. To retrieve more upload URLs for an upload
that's already in progress, call GetAttachmentUploadLinks again with the existing
uploadId and a new uploadRange.
Upload each part to its presigned URL by using HTTP PUT and capture the ETag
from the response. After you upload all parts, call CompleteAttachmentUpload
with the uploadId and the list of part indexes and ETags to finalize the upload.
You can then attach the upload to a case by passing the uploadId in the
uploadIds parameter of CreateCase or AddCommunicationToCase. To monitor progress before completion, call DescribeAttachmentUploadStatus.
Note
-
You must have an AWS Business Support+, AWS Enterprise Support, or AWS Unified Operations plan to use the AWS Support API. If you're in an AWS Region that doesn't offer one of these AWS Support plans, or if you haven't transitioned to one of these plans, you can use the AWS Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.
-
If you call the AWS Support API from an account that doesn't have an AWS Business Support+, AWS Enterprise Support, or AWS Unified Operations plan, the
SubscriptionRequiredExceptionerror message appears. For information about changing your support plan, see AWS Support.
Request Syntax
{
"dryRun": boolean,
"fileName": "string",
"fileSizeBytes": number,
"uploadId": "string",
"uploadRange": {
"endIndex": number,
"startIndex": number
}
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- dryRun
-
Specifies whether to validate the request without actually generating upload URLs. When set to
true, the request is validated but no URLs are returned, and the operation returns aDryRunOperationException. When omitted or set tofalse, the request runs normally.Type: Boolean
- fileName
-
The name of the file to upload, including the file extension. This value is required when you initiate a new upload.
Type: String
- fileSizeBytes
-
The total size of the file in bytes. The service uses this value to calculate the total number of parts and the size of each part. Required when you initiate a new upload (when
uploadIdisn't provided). Valid range: 1 to 157,286,400 bytes (approximately 150 MB).Type: Long
Valid Range: Minimum value of 1. Maximum value of 157286400.
- uploadId
-
The unique identifier of an in-progress multipart upload, returned by a previous call to
GetAttachmentUploadLinks. SpecifyuploadIdto retrieve additional presigned upload URLs for an upload that has already been initiated. Required whenfileSizeBytesisn't provided. Length: 1 to 2,048 characters.Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
- uploadRange
-
The range of part indexes for which to return presigned upload URLs. Use this parameter to page through the upload URLs for a large file across multiple calls. If you omit this parameter, the service determines the range to return.
Type: UploadRange object
Response Syntax
{
"nextIndex": number,
"partSizeBytes": number,
"totalParts": number,
"uploadId": "string",
"uploadUrls": [
{
"expiryDate": "string",
"partIndex": number,
"url": "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.
- nextIndex
-
The next part index to request presigned URLs for. If all upload URLs for the file have been returned, this field is
null. Use this value as thestartIndexinuploadRangeon a subsequent call toGetAttachmentUploadLinksto retrieve the next batch of upload URLs.Type: Integer
- partSizeBytes
-
The size, in bytes, of each part. Split the file into parts of this size before you upload them to the presigned URLs. For an upload with
ntotal parts, parts 1 throughn- 1 are exactly this size; the last part may be smaller. Maximum: 104,857,600 bytes (approximately 100 MB).Type: Long
Valid Range: Minimum value of 1. Maximum value of 104857600.
- totalParts
-
The total number of parts that the file is split into. Upload one part to each presigned URL.
Type: Integer
- uploadId
-
The unique identifier for the multipart upload. Use this value in subsequent calls to
GetAttachmentUploadLinks, DescribeAttachmentUploadStatus, and CompleteAttachmentUpload, and to attach the upload to a case through theuploadIdsparameter on CreateCase or AddCommunicationToCase.Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
- uploadUrls
-
The list of presigned upload URLs for the requested range of parts. The list contains at most 10 URLs per call. Upload each part to its corresponding URL by using HTTP
PUTbefore the URL expires.Type: Array of UploadUrl objects
Errors
For information about the errors that are common to all actions, see Common Error Types.
- DryRunOperationException
-
The request was valid, but the operation wasn't performed because
dryRunwas set totrue.HTTP Status Code: 400
- InternalServerError
-
An internal server error occurred.
- message
-
An internal server error occurred.
HTTP Status Code: 500
- UploadIdNotFound
-
The specified
uploadIdcouldn't be located.HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: