v1/collections/{collectionId}/exchanges/{exchangeId}/assets:sync
Download the specified assets to use in your client. You can provide exchange snapshot revision IDs in the query parameter to calculate a delta. The delta returns just the assets that have been created, modified, or removed between revisions. If you don’t specify revision IDs, then you will download all assets.
Valid filters:
- Array of asset IDs: The asset’s ID must match one of the specified IDs. Supports == and =in=.
example: assetId=in=(FmY4KxRfdqQmjMMAgCPfFo_aga, MYAyVLrjPhUg4xvb6fOUV6_aga)
- Exchange snapshot fromRevision & toRevision: The fromRevision is exclusive & toRevision is Inclusive. Keyword latest & latest-1 is also supported instead of revisionId. Supports ==.
example: exchange.snapshot.fromRevision==YRc2mxEFc1KvVPVmkFQhnX;exchange.snapshot.toRevision==YRc2mxEFc1KvVPVmkFQhnX
example: exchange.snapshot.fromRevision==latest-1;exchange.snapshot.toRevision==latest
- Asset type name: The asset with name Supports ==
example: asset.type.name==autodesk.design:assets.instance-1.0.0
- Asset category: The asset with category. Supports ==
example: asset.parameter.category==Windows
- Asset family: The asset with family. Supports ==
example: asset.parameter.family==Basic Wall
- Asset type: The asset with type. Supports ==
example: asset.parameter.type==Generic-8
- Asset type Id: The asset with type id. Supports ==
example: asset.parameter.typeId==autodesk.revit.parameter:wallAttrRoomBounding-1.0.0
- Asset name: The asset with parameter name.Supports ==
example: asset.parameter.name==”Cross-Section”
- Asset parameter name & value: The name & value of the asset’s parameter. The asset.parameter.value filter needs to be used along with asset.parameter.name. Supports ==
example: asset.parameter.name==”Cross-Section” and asset.parameter.value==1
- Asset reference parameter name & value: The name & value of the asset’s reference parameter. The asset.refParameter.value filter needs to be used along with asset.refParameter.name.Supports ==
example: asset.refParameter.name==”Base Constraint” and asset.refParameter.value==92F5BE62F9DA0107E98E3B44DEA46648817E89D1
- Asset reference parameter name & value: The name & value of the asset’s reference parameter. Supports ==
example: asset.refParameter.typeId==autodesk.revit.parameter:clearCoverExterior-1.0.0 and asset.refParameter.value==AF2ACFCED97EE03F9C3531E78A240122C8034E58
Resource Information
Method and URI | POST https://developer.api.autodesk.com/exchange/v1/collections/{collectionId}/exchanges/{exchangeId}/assets:sync |
Authentication Context | app only |
Required OAuth Scopes | data:read |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via OAuth |
Content-Type* string | Must be application/json |
Request
URI Parameters
collectionId string | The unique ID of the collection |
exchangeId string | The unique ID of the exchange |
Request
Body Structure
assets* array: string | |
filter object | |
revision string | Download the assets at a specific revision |
includes object | |
fields array: string | Values: attributes |
Response
HTTP Status Code Summary
200 OK | The synced asset data was retrieved successfully. |
400 Bad Request | The request is invalid. |
401 Unauthorized | Invalid authorization header. |
403 Forbidden | Access denied regardless of authorization status. |
404 Not Found | The specified resource was not found. |
500 Internal Server Error | Unexpected service interruption. |
Response
Body Structure (200)
results array: object | The requested assets |
createdBy object | The information on the user or service that last modified the entity. |
userId string | The user ID that created / modified the entity. |
serviceId string | The service ID that created / modified the entity. |
date datetime: ISO 8601 | Timestamp in the following format: YYYY-MM-DDThh:mm:ss.sz . |
lastModifiedBy object | The information on the user or service that last modified the entity. |
userId string | The user ID that created / modified the entity. |
serviceId string | The service ID that created / modified the entity. |
date datetime: ISO 8601 | Timestamp in the following format: YYYY-MM-DDThh:mm:ss.sz . |
id string | The unique ID of the asset |
revisionId string | The ID of the latest revision of the asset |
type string | The type of the asset, which is a combination of type name and type version |
space object | |
id string | The unique ID of the entity |
type string | The type of the entity |
url string | The URL to get the entity |
data object | The content of the entity |
attributes object | All attributes associated with this exchange |
id string | The unique id of the attribute |
url string | |
data array: object | |
name string | The name of the attribute |
value string | The value of the attribute |
category string | The category of the attribute. Possible values: system , application , internal . |
components object | All components associated with this exchange |
id string | The unique ID of the entity |
url string | The relative URL to get the entity’s components |
data object | See HFDM Schema Specification 1.0 - Change Sets |
insert object | Components to be inserted |
* object | Components to be inserted |
modify object | Components to be modified |
* object | Components to be modified |
remove array: string | Component IDs to be removed |
externalComponentHash string | Client-supplied ID derived from the components of an asset |
operation enum:string | The type of operation. Possible values: INSERT , MODIFY , REMOVE . |
errors array: string | List of assets that failed in query |
Example
The synced asset data was retrieved successfully.
Request
curl -v 'https://developer.api.autodesk.com/exchange/v1/collections/:collectionId/exchanges/:exchangeId/assets:sync' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"assets": [
""
],
"filter": {
"exchange.snapshot.revision": ""
},
"includes": {
"fields": [
""
]
}
}'
Response
{
"results": [
{
"createdBy": {
"userId": "QTCWNHC87PKH",
"serviceId": "test-client-id",
"date": "2021-07-07T17:30:31.395476Z"
},
"lastModifiedBy": {
"userId": "QTCWNHC87PKH",
"serviceId": "test-client-id",
"date": "2021-07-07T17:30:31.395476Z"
},
"id": "5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"revisionId": "1665777201820_37d52f49-024e-3a65-88ec-31ff3b599988",
"type": "autodesk.design:assets.design-1.0.0",
"space": {
"id": "5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"type": "autodesk.design:assets.instance-1.0.0",
"url": "/collections/co.l1Lf2-orRbW-3oDLHMvSxg/assets/5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"data": {}
},
"attributes": {
"id": "976jvaa5-67c5-31e0-9b41-488cc9ff2ab4",
"url": "/exchanges/6e21c319-c9f3-3350-bb67-d103b401409d/attributes",
"data": [
{
"category": "Application",
"name": "sourceVersionUrn",
"value": "urn:adsk.wipqa:fs.file:vf.XV24N2BxRkmzL-iw45HUDQ?version=1"
}
]
},
"components": {
"id": "entityId",
"url": "/entityType/entityId/components",
"data": {
"insert": {
"autodesk.fdx:test-1.0.0": {
"test": {
"String": {
"prop1": "value1",
"prop2": "value2"
}
}
}
},
"modify": {
"autodesk.fdx:test-1.0.0": {
"test": {
"String": {
"prop1": "value3"
}
}
}
},
"remove": [
"autodesk.fdx:test-1.0.0"
]
}
},
"externalComponentHash": "DA21CBAE2C2A33FA21580A4CB07B3949E8C9E33D",
"operation": "INSERT"
}
],
"errors": [
""
]
}