Request

Response

    Complete an upload
    POST

    spaces/{spaceId}/uploads:complete

    Complete a previously started upload.

    Resource Information

    Method and URI
    POST
    https://developer.api.autodesk.com/flow/storage/v1/spaces/{spaceId}/uploads: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.

    Request

    Body Structure

    Expand all
    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
    400
    Bad Request
    Bad request - indicates an incorrectly structured 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
    409
    Conflict
    Conflict - the completion request could not be processed because of a conflict with the currently uploaded parts.
    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)

    size
    int
    Total size of the resource.
    urn
    string
    The URN for the resource.

    Example

    This example completes the upload for resource inputFile which was uploaded as a single part.

    Request

    curl -v 'https://developer.api.autodesk.com/flow/storage/v1/spaces/scratch:@default/uploads:complete' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGci...' \
      -H 'Content-Type: application/json'\
      -d '{
            "resourceId": "inputFile",
            "uploadId": "AQICAHjdZwoyN...",
            "parts": [
                {
                    "etag": "262fb6d1486930b3126c6f6ed0be1174"
                }
            ]
          }'
    
    Show More

    Response

    {
        "size":1146048,
        "urn":"urn:adsk:fc.scratch:us-west.prd:resource:@default/inputFile"
    }