Request

Response

    Get upload URLs for multiple resources
    POST

    spaces/{spaceId}/resources:batch-get-upload-urls

    Get upload URLs for multiple resources in one request. Different storage providers may impose limits on the number of objects, URLs per object, or total number of URLs that can be retrieved in one go. OSS limits the total number of URLs to 25 per request.

    Resource Information

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

    Query String Parameters

    expirationInMinutes
    int
    Specify the desired expiry time in minutes.

    Request

    Body Structure

    Expand all
    requests*
    array: object
    Contains an array of individual requests for upload URLs.
    partId
    int
    ID for an individual upload part
    numParts
    int
    A number of parts, with imposed limits.
    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 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
    404
    Not Found
    The specified resource was not found
    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
    Contains a list of errors that were encountered when trying to complete the request, one item per failed request.
    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
    resourceId
    string
    A unique ID for a specific resource
    results
    array: object
    An array of the successfully retrieved upload URLs, one item per resource.
    expiresAt
    datetime: ISO 8601
    Time of expiration for the URLs. This expiration time is approximate and may not exactly match the real expiration time.
    urls
    array: object
    An array
    partId
    int
    ID for an individual upload part
    url
    string
    Upload URL for the part.
    upload
    object
    Information about an upload operation
    expiresAt
    datetime: ISO 8601
    The time at which the upload must be completed. If the upload is not completed by this date, the upload expires.
    id
    string
    An ID for a specific upload operation
    resourceId
    string
    A unique ID for a specific resource
    resourceId
    string
    A unique ID for a specific resource

    Response

    Body Structure (207)

    Expand all
    errors
    array: object
    Contains a list of errors that were encountered when trying to complete the request, one item per failed request.
    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
    resourceId
    string
    A unique ID for a specific resource
    results
    array: object
    An array of the successfully retrieved upload URLs, one item per resource.
    expiresAt
    datetime: ISO 8601
    Time of expiration for the URLs. This expiration time is approximate and may not exactly match the real expiration time.
    urls
    array: object
    An array
    partId
    int
    ID for an individual upload part
    url
    string
    Upload URL for the part.
    upload
    object
    Information about an upload operation
    expiresAt
    datetime: ISO 8601
    The time at which the upload must be completed. If the upload is not completed by this date, the upload expires.
    id
    string
    An ID for a specific upload operation
    resourceId
    string
    A unique ID for a specific resource
    resourceId
    string
    A unique ID for a specific resource

    Example

    This example creates an upload for the resources inputFile1 and inputFile2 and retrieves upload URLs for multipart upload.

    Request

    curl -v 'https://developer.api.autodesk.com/flow/storage/v1/spaces/scratch:@default/resources:batch-get-upload-urls' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtp...' \
      -H 'Content-Type: application/json'\
      -d '{
            "requests": [
                {
                    "resourceId": "inputFile1",
                    "numParts": 3
                },
                {
                    "resourceId": "inputFile2",
                    "numParts": 2
                }
            ]
          }'
    
    Show More

    Response

    {
      "results": [
        {
          "resourceId": "inputFile1",
          "urls": [
            {
              "url": "https://com-autodesk-oss-direct-upload.s3.amazonaws.com/e3/21/..."
            },
            {
              "url": "https://com-autodesk-oss-direct-upload.s3.amazonaws.com/e3/21/..."
            },
            {
              "url": "https://com-autodesk-oss-direct-upload.s3.amazonaws.com/e3/21/..."
            }
          ],
          "upload": {
            "expiresAt": "2024-04-28T00:00:00Z",
            "id": "AQICAHjdZwoyNEgA8bmp66wG...",
            "resourceId": "inputFile1"
          }
        },
        {
          "resourceId": "inputFile2",
          "urls": [
            {
              "url": "https://com-autodesk-oss-direct-upload.s3.amazonaws.com/4a/c2...",
            },
            {
              "url": "https://com-autodesk-oss-direct-upload.s3.amazonaws.com/4a/c2...",
            }
          ],
          "upload": {
            "expiresAt": "2024-04-28T00:00:00Z",
            "id": "AQICAHjdZwoyNEgA8bmp6...",
            "resourceId": "inputFile2"
          }
        }
      ],
      "errors": []
    }
    
    Show More