projects/{projectId}/items/{itemId}/attachments
Retrieve information about attachments associated with a specified item. You can use the information to download attachments. For more information, see the Download Submittal Attachments tutorial.
Resource Information
Method and URI | GET https://developer.api.autodesk.com/construction/submittals/v2/projects/:projectId/items/:itemId/attachments |
Authentication Context | user context required |
Required OAuth Scopes | data:read |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via a three-legged OAuth flow. |
Request
URI Parameters
itemId string | The ID of the item. To find the item ID, call GET items. |
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 need to convert the project ID into a project ID for the ACC API by removing the “b." prefix. For example, a project ID of b.a4be0c34a-4ab7 translates to a project ID of a4be0c34a-4ab7. |
Request
Query String Parameters
limit int | The number of results to return per page in the response payload. Possible values: 1 - 50 . Default value: 20 . For example, to limit the response to two results per page, use limit=2 . |
offset int | The page number from which you want to begin results; for example, offset=20 . For more details, see the JSON API Paging documentation. |
sort string | Sort attachments by specific fields in either ascending (asc ) or descending (desc ) order. Separate multiple criteria with commas. For example, statusId asc .
Possible values: |
filter[categoryId] string | Filter attachments by category identifier. Multiple values can be separated by commas. |
filter[revision] string | Filter items with the specified revision number. You can specify multiple values. Separate multiple values with commas. For example, filter[revision]=1 . |
filter[isFileUploaded] string | true : to filter files that are uploaded.
|
Response
HTTP Status Code Summary
200 OK | An attachments list. |
400 Bad Request | The request could not be understood by the server due to malformed syntax or missing request headers. |
401 Unauthorized | Invalid Authorization header. Verify and try again. |
403 Forbidden | The user is not authorized to perform this action. |
404 Not Found | The specified resource was not found. |
500 Internal Server Error | An unexpected error occurred on the server while processing the request. |
Response
Body Structure (200)
pagination object | Pagination information. |
limit int | The maximum number of results to be displayed on each page. |
offset int | The number of results to skip before starting to display results on a page. |
totalResults int | The overall count of results available across all pages. |
previousUrl string | The URL to retrieve the preceding page of results, if applicable. Not returned on the first page of results. |
nextUrl string | The URL to retrieve the subsequent page of results, if available. If not included, this is the last page of data. |
results array: object | The list of attachments. |
id string: UUID | The internal, globally unique identifier (UUID) for the attachment. |
itemId string: UUID | The ID of the item associated with the attachment. |
taskId string: UUID | Not relevant |
name string | The name of the attachment. |
isFileUploaded boolean | true : if the attachment upload is complete
|
url string | The URL of the attachment. |
asyncState enum:string | The current state of the upload. Possible values: 1 (pending), 2 (started), 3 (success), 4 (failure). |
uploadUrn string | The upload ID of the attachment. |
urn string | The ID of the version of the file. |
urnVersion int | The version number of the file. |
revisionFolderUrn string | The ID of the folder that contains the file. |
revision int | Not relevant |
urnTypeId enum:string | The type of URN. Possible values: 1 (OSS), 2 (DM) |
categoryId enum:string | The ID of the state of the item associated with the attachment. Possible values: 1 (Submission), 2 (For Review), 3 (Review Response), 4 (Final Response), 5 (Previous Submission), 6 (Previous For Review), 7 (Previous Review Response), 8 (Previous Final Response). |
urnPage string | Not relevant |
resourceUrns string | Not relevant |
createdBy string | The Autodesk ID of the user who created the attachment. |
createdAt datetime: ISO 8601 | The date and time when the attachment created. |
updatedAt datetime: ISO 8601 | The date and time the attachment was last updated. |
updatedBy string | The Autodesk ID of the user who last updated the attachment. |
duplicatedFrom string: UUID | The ID of the source file the attachment was duplicated from. |
permittedActions array: object | A list of actions that the user is allowed to perform on the submittal item. |
id string | The ID of the action in the format type_of_object::action . For example, Item::retrieve . |
fields object | A mapping of field names to lists of possible values for each field. Note that an empty array indicates that there is no specific set of values for those fields. |
mandatoryFields array: string | Fields required to perform specific actions, such as creating or transitioning a submittal item. The required fields depend on the user’s role and the action.
For example, creating a submittal item in the |
transitions array: object | Not relevant |
id string | Not relevant |
name string | Not relevant |
stateFrom object | Not relevant |
id string | Not relevant |
name string | Not relevant |
stateTo object | Not relevant |
id string | Not relevant |
name string | Not relevant |
transitionFields array: string | Not relevant |
mandatoryFields array: string | Not relevant |
actionId string | Not relevant |
Example
An attachments list.
Request
curl -v 'https://developer.api.autodesk.com/construction/submittals/v2/projects/9eae7d59-1469-4389-bfb2-4114e2ba5545/items/767b5888-2c6a-413d-8487-613966dd64ce/attachments' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a'
Response
{
"pagination": {
"limit": 10,
"offset": 100,
"totalResults": 25,
"previousUrl": "https://developer.api.autodesk.com/construction/submittals/v2/projects/9eae7d59-1469-4389-bfb2-4114e2ba5545/items/767b5888-2c6a-413d-8487-613966dd64ce/attachments?limit=5&offset=10",
"nextUrl": null
},
"results": [
{
"id": "1d0a9b65-f411-4eb2-b6bb-69f8ea483207",
"itemId": "2df3b4cf-16f4-496e-8173-7125f31e3dd1",
"taskId": "1ab2ae43-fb33-4868-be85-03f4873915fc",
"name": "attachment-document.pdf",
"isFileUploaded": "true",
"url": null,
"asyncState": "1",
"uploadUrn": "urn:adsk.objects:os.object:wip.dm.qa/1a8148a6-d74e-4a6b-8cf2-38f2074f87d1.pdf",
"urn": "urn:adsk.wipprod:fs.file:vf.TQW6YsrTTFGrJVJKAaK_ew?version=1",
"urnVersion": 1,
"revisionFolderUrn": "urn:adsk.wipprod:fs.folder:co.3is_lyUzTxu6nNXobG2P7Q\"",
"revision": 0,
"urnTypeId": "1",
"categoryId": "1",
"urnPage": null,
"resourceUrns": null,
"createdBy": "WD43ZJGKDFLFH",
"createdAt": "2018-02-01T12:09:24.198466Z",
"updatedAt": "2018-02-01T12:09:24.198466Z",
"updatedBy": "WD43ZJGKDFLFH",
"duplicatedFrom": "f4635373-a5b4-456c-af8d-e0446652967c",
"permittedActions": [
{
"id": "Item::retrieve",
"fields": {},
"mandatoryFields": [
""
],
"transitions": [
{
"id": "rev::void",
"name": "Send to void",
"stateFrom": {
"id": "rev",
"name": "REV"
},
"stateTo": {
"id": "rev",
"name": "REV"
},
"transitionFields": [
"subcontractor",
"subcontractorType",
"watchers",
"responseId"
],
"mandatoryFields": [
"responseId"
],
"actionId": "ITEM_TRANSITION_REV_VOID"
}
]
}
]
}
]
}