Complete multiple uploads
POST
spaces/{spaceId}/uploads:batch-complete
Complete uploads across multiple resources.
Resource Information
Method and URI | POST https://developer.api.autodesk.com/flow/storage/v1/spaces/{spaceId}/uploads:batch-complete |
Authentication Context | user context optional |
Required OAuth Scopes | data:write |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via either a two-legged or three-legged OAuth flow. |
region string | The region targeted by the request. The usage of this header is recommended for faster processing. The region specified must match the region in which the targeted storage space was created or else the request will fail. |
Content-Type* string | Must be application/json |
* Required
Request
URI Parameters
spaceId string | The ID of the storage space, specified as <storage provider>:<storage space key>. For example scratch:@default indicates the @default storage space for the Scratch storage provider. |
Request
Body Structure
Expand all
requests* array: object | Contains information about the uploads to be completed. |
contentType string | Specifies the content type for a resource. |
contentDisposition string | Specifies the content disposition for a resource. |
contentEncoding string | Specifies the content encoding for a resource. |
cacheControl string | Specifies caching directives to control caching in browsers and shared caches for a resource. |
parts* array: object | A list of parts that combine to make up the resource. The list must be complete and in the correct order. |
eTag string | Entity tag returned when the part was uploaded |
partId int | ID for an individual upload part |
size int | The total size of the resource. A storage provider may use this value to validate the combined size of the parts to match this value. |
resourceId* string | A unique ID for a specific resource |
uploadId* string | An ID for a specific upload operation |
* Required
Response
HTTP Status Code Summary
200 OK | OK |
207 | Multi-Status |
400 Bad Request | Bad request - indicates an incorrectly structure or otherwise incorrect request. |
401 Unauthorized | Unauthorized - credentials are invalid or not provided in the request |
403 Forbidden | Forbidden - the user/entity does not have the required privileges to access this resource |
429 Too Many Requests | Too Many Requests |
Response
Header (429)
Retry-After integer | Specifies how many seconds to wait before making a new request. |
Response
Body Structure (200)
Expand all
errors array: object | Information about completions that failed, one item per failed upload. |
title string | The title for the error |
type string | A URI indicating the type of the error that if present can be used to programmatically check for certain error types. The URI is purely an identifier and clients should not automatically dereference the URI. |
detail string | Provides more detail about the error |
size object | Describes any discrepancy between the object size provided by the user, and the actual object size detected by the storage provider. This check is skipped entirely if the user provides no size parameter in the request. |
expected int | The expected size of the resource, as provided in the completion request. |
detected int | The actual size of the resource in bytes. |
parts array: object | An array containing the status of each part, indicating any issues in eTag mismatch or size issues. |
eTag string | The ETag of the uploaded part as reported by the underlying storage provider. |
partId int | ID for an individual upload part |
size int | The actual uploaded size of a part in bytes |
status object | Indicates whether this particular part uploaded correctly or not
Possible values: OK , PENDING , TOO_SMALL , UNEXPECTED |
resourceId string | A unique ID for a specific resource |
uploadId string | An ID for a specific upload operation |
results array: object | Contains details about successful upload completions. |
size int | Total size of the resource. |
urn string | The URN for the resource. |
resourceId string | A unique ID for a specific resource |
uploadId string | An ID for a specific upload operation |
Response
Body Structure (207)
Expand all
errors array: object | Information about completions that failed, one item per failed upload. |
title string | The title for the error |
type string | A URI indicating the type of the error that if present can be used to programmatically check for certain error types. The URI is purely an identifier and clients should not automatically dereference the URI. |
detail string | Provides more detail about the error |
size object | Describes any discrepancy between the object size provided by the user, and the actual object size detected by the storage provider. This check is skipped entirely if the user provides no size parameter in the request. |
expected int | The expected size of the resource, as provided in the completion request. |
detected int | The actual size of the resource in bytes. |
parts array: object | An array containing the status of each part, indicating any issues in eTag mismatch or size issues. |
eTag string | The ETag of the uploaded part as reported by the underlying storage provider. |
partId int | ID for an individual upload part |
size int | The actual uploaded size of a part in bytes |
status object | Indicates whether this particular part uploaded correctly or not
Possible values: OK , PENDING , TOO_SMALL , UNEXPECTED |
resourceId string | A unique ID for a specific resource |
uploadId string | An ID for a specific upload operation |
results array: object | Contains details about successful upload completions. |
size int | Total size of the resource. |
urn string | The URN for the resource. |
resourceId string | A unique ID for a specific resource |
uploadId string | An ID for a specific upload operation |
Example
This example complete the upload for resource inputFile1 and inputFile2. inputFile was uploaded in a single part and inputFile2 was uploaded in 2 parts.
Request
curl -v 'https://developer.api.autodesk.com/flow/storage/v1/spaces/scratch:@default/uploads:batch-complete' \
-X 'POST' \
-H 'Authorization: Bearer eyJhbGciOi...' \
-H 'Content-Type: application/json'\
-d '{
"requests": [
{
"resourceId": "inputFile1",
"uploadId": "AQICAHjdZ...",
"parts": [
{
"etag": "262fb6d1486930b3126c6f6ed0be1174"
}
]
},
{
"resourceId": "inputFile2",
"uploadId": "AQICAHjdZw...",
"parts": [
{
"etag": "262fb6d1486930b3126c6f6ed0be1174"
},
{
"etag": "262fb6d1486930b3126c6f6ed0be1174"
}
]
}
]
}'
Show More
Response
{
"results":
[
{
"resourceId":"inputFile1",
"uploadId":"AQICAHjdZ...",
"size":1146048,
"urn":"urn:adsk:fc.scratch:us-west.prd:resource:@default/inputFile1"
},
{
"resourceId":"inputFile2",
"uploadId":"AQICAHjdZw...",
"size":2302106,
"urn":"urn:adsk:fc.scratch:us-west.prd:resource:@default/inputFile2"
}
],
"errors":[]
}
Show More