projects/{projectId}/storage
Creates a storage location in the Object Storage Service (OSS) for you to upload the file to. This endpoint is typically used during the process of uploading files to the ACC Sheets tool.
For more details, see the Upload Sheets tutorial.
Resource Information
Method and URI | POST https://developer.api.autodesk.com/construction/sheets/v1/projects/{projectId}/storage |
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. |
x-user-id string | The ID of the user on whose behalf the API request is made. This header is optional when using a 2-legged OAuth2, but required if using 2-legged OAuth2 with user impersonation.
When using 2-legged OAuth2 without user impersonation, your app has access to all users defined by the administrator in the SaaS integrations UI. However, when user impersonation is enabled, the API call is restricted to act only on behalf of the specified user. This header is not relevant for 3-legged OAuth2. You can use either the user’s ACC ID (id), or their Autodesk ID (autodeskId). |
Content-Type* string | Must be application/json |
Request
URI Parameters
projectId string: UUID | The ID of the project. Use the Data Management API to retrieve the project ID. For more information, see the Retrieve a Project ID tutorial. You can use a project ID either with a “b.” prefix or without a “b.” prefix. For instance, a project ID of “b.a4be0c34a-4ab7” can also be referred to as “a4be0c34a-4ab7”. |
Request
Body Structure
fileName string | The name of the file.
Currently Sheets tool only supports PDF files. Max length: 255 |
Response
HTTP Status Code Summary
201 Created | Successfully created a storage object. |
400 Bad Request | The parameters of the requested operation are invalid. |
403 Forbidden | The user or client represented by the bearer token does not have permission to perform this operation. |
404 Not Found | The requested resource cannot be found. |
429 Too Many Requests | The server has received too many requests. |
500 Internal Server Error | An unexpected error occurred on the server. |
Response
Body Structure (201)
urn string | The URN of the storage.
Note that in Sheets each project has its own OSS bucket, it is recommended to extract bucket key from storage URN every time before you call OSS APIs. |
Example
Successfully created a storage object.
Request
curl -v 'https://developer.api.autodesk.com/construction/sheets/v1/projects/9ba6681e-1952-4d54-aac4-9de6d9858dd4/storage' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"fileName": "example.pdf"
}'
Response
{
"urn": "urn:adsk.objects:os.object:bimdocs.9ba6681e-1952-4d54-aac4-9de6d9858dd4/67a2d96a-b1d7-474f-86ba-9e01a5c0f5be.pdf"
}