Get a download URL for a resource
GET
spaces/{spaceId}/resources/{resourceId}/download-url
Get a presigned URL to download the resource specified by the resourceId.
Resource Information
Method and URI | GET https://developer.api.autodesk.com/flow/storage/v1/spaces/{spaceId}/resources/{resourceId}/download-url |
Authentication Context | user context optional |
Required OAuth Scopes | data:read |
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. |
If-Modified-Since string | If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message-body. |
If-None-Match string | If the value of this header matches the ETag of the object, an entity will not be returned from the server; instead a 304 (not modified) response will be returned without any message-body. |
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. |
* 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. |
resourceId string | The resource ID |
Request
Query String Parameters
expirationInMinutes int | Specify the desired expiry time in minutes. |
responseCacheControl string | Customizes the Cache-Control header in the response. |
responseContentDisposition string | Customizes the Content-Disposition header in the response. |
responseContentType string | Customizes the Content-Type header in the response. |
Response
HTTP Status Code Summary
200 OK | OK |
304 Not Modified | The specified resource was not modified compared to the given criteria. No content is sent. |
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 |
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)
url string | A URL that can be accessed to retrieve the actual data for a resource. The URL expires after a certain amount of time depending on the storage provider and the parameters to the request to generate the URL. |
sha1 string | Base64-encoded SHA1 checksum of the resource.
Max length: 40 |
size int | The size of the object in bytes. |
Example
This example get a download url for the inputFile resouce on the scratch:@default storage space.
Request
curl -v 'https://developer.api.autodesk.com/flow/storage/v1/spaces/scratch:@default/resources/inputFile/download-url' \
-X 'GET' \
-H 'Authorization: Bearer eyJhbGciOiJ...' \
Response
{
"url":"https://s3.amazonaws.com/com.autodesk.oss-temporary/22/6e/...",
"size":573024,
"sha1":"226e3f5bb36285397cdd136a0eb3d63a3e78affa"
}