v1/collections/{collectionId}/exchanges/{exchangeId}/relationships:sync
Download the specified relationships 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 relationships that have been created, modified, or removed between revisions. If you don’t specify revision IDs, then you will download all relationships.
Valid filters:
- 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
- From asset id: The relationship must contain an asset with the specified id value. Supports ==.
example: from.asset.id==626e1a881f2447ad93eed68a3c684f25
- To asset id: The relationship must contain an asset with the specified id value. Supports ==.
example: to.asset.id==626e1a881f2447ad93eed68a3c684f25
Resource Information
Method and URI | GET https://developer.api.autodesk.com/exchange/v1/collections/{collectionId}/exchanges/{exchangeId}/relationships: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 |
Accept-Encoding string |
Request
URI Parameters
collectionId string | The unique ID of the collection |
exchangeId string | The unique ID of the exchange |
Request
Query String Parameters
filters string | Filter, RSQL syntax. You can specify multiple filters, separated by semi-colon ; . |
cursor string | The pagination cursor returned by the server to the client. It expires in 10 minutes. |
limit int | Allowed limit is between 1 and 500. |
sort string | The sort order of the entities returned |
Response
HTTP Status Code Summary
200 OK | The synced relationship 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)
pagination object | The information on the pagination of the response |
limit int | Upper limit to the paginated results |
cursor string | Current cursor (or index) marking where you are in the paginated set |
nextUrl string | Next URL |
results array: object | The paginated results |
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 relationship |
type string | The type of the relationship, which is a combination of type name and type version |
from object | |
asset 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 |
snapshot 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 |
to object | |
asset 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 |
snapshot 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 |
category string | The category of the relationship. Possible values: Reference , Relationship . |
revisionId string | The ID of the latest revision of the relationship |
operation enum:string | The type of operation. Possible values: INSERT , MODIFY , REMOVE . |
attributes 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 |
root string | The unique ID identifying the root entity within the paginated results |
Example
The synced relationship data was retrieved successfully.
Request
curl -v 'https://developer.api.autodesk.com/exchange/v1/collections/:collectionId/exchanges/:exchangeId/relationships:sync?filters=exchange.snapshot.fromRevision==YRc2mxEFc1KvVPVmkFQhnX;exchange.snapshot.toRevision==YRc2mxEFc1KvVPVmkFQhnX;asset.id==626e1a881f2447ad93eed68a3c684f25' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a'
Response
{
"pagination": {
"limit": 95,
"cursor": "46daa630-5f1c-4e46-b004-b512ff3649ac",
"nextUrl": "/v1/collections/co.l1Lf2-orRbW-3oDLHMvSxg/exchanges/3f351bac-f192-3e8a-9eae-e7f71e55d65f/assets:sync?cursor=46daa630-5f1c-4e46-b004-b512ff3649ac"
},
"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": "f68a7f57-8907-4e4f-a1f8-c25eca699b04",
"type": "autodesk.design:relationship.containment-1.0.0",
"from": {
"asset": {
"id": "5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"type": "autodesk.design:assets.instance-1.0.0",
"url": "/collections/co.l1Lf2-orRbW-3oDLHMvSxg/assets/5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"data": {}
},
"snapshot": {
"id": "5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"type": "autodesk.design:assets.instance-1.0.0",
"url": "/collections/co.l1Lf2-orRbW-3oDLHMvSxg/assets/5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"data": {}
}
},
"to": {
"asset": {
"id": "5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"type": "autodesk.design:assets.instance-1.0.0",
"url": "/collections/co.l1Lf2-orRbW-3oDLHMvSxg/assets/5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"data": {}
},
"snapshot": {
"id": "5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"type": "autodesk.design:assets.instance-1.0.0",
"url": "/collections/co.l1Lf2-orRbW-3oDLHMvSxg/assets/5F1A0BDA83EA6234B960375CF4401917A5EC1050",
"data": {}
}
},
"category": "Relationship",
"revisionId": "1665776300314_4cb0b7c5-65fb-3701-bf9b-b3db3f095587",
"operation": "INSERT",
"attributes": {
"name": "rootAssetId",
"value": "ec78857a-9831-3fdf-b598-8c7214a30d33_STABLE1",
"category": "application"
},
"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"
]
}
}
}
],
"root": "1616148972940_19934de8-2b10-30c2-a35f-a072fc1cba73"
}