Queries
exchangeByFileUrn
Retrieves a single exchange by externalProjectId and fileUrn.
Template for Query:
query GetExchangeByFileUrn($externalProjectId: ID!, $fileUrn: ID!) {
exchangeByFileUrn(externalProjectId: $externalProjectId, fileUrn: $fileUrn) {
# ExchangeByFileUrn Fields
}
}
Template for Query Variables:
{
"externalProjectId" : "<SOME-ID-TYPE-SCALAR-VALUE>",
"fileUrn" : "<SOME-ID-TYPE-SCALAR-VALUE>"
}
Arguments
| externalProjectId* ID! non-null | The external project Id. |
| fileUrn* ID! non-null | The Exchange file Id. |
* Required
Possible Returns
| Value Type | Description |
|---|---|
Exchange! non-null |
A specific collection of Elements. |
Examples
Example 1
Retrieves a single exchange by exchangeFileIUrn and ProjectId.
Query:
query GetExchangeByFileUrn($externalProjectId: ID!, $fileUrn: ID!) {
exchangeByFileUrn(externalProjectId: $externalProjectId, fileUrn: $fileUrn) {
id
name
elements {
results {
id
name
}
}
}
}
Show More
Query Variables:
{
"externalProjectId" : "22a5dc47-ca19-4231-9f3e-157ebd4842ff",
"fileUrn" : "urn:adsk.wipprod:fs.file:vf.TtCj4eUwSaSlYnoveo3Znw"
}
Response:
{
"data": {
"exchangeByFileUrn": {
"id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfmQ5N2Y2MTUxLTZhNTAtMzhjMi1hYmY5LWI0OGYxMDYyNGU5ZQ",
"name": "3D_Architectural_Overall_1791_Objects",
"elements": {
"results": [
{
"id": "034E45FDC11CA33DB6B8D00165C9E5A68C2770C6",
"name": "Railing__55607"
},
{
"id": "01A98D866211C82009CACC28C46746B12EFA5F6F",
"name": "264811"
},
{
"id": "0BCEFFBD45DCB27A186CE1DFA5E906EE107CF7F2",
"name": "73704"
},
{
"id": "068B1135E85D2D8C381CCE33343A682FB0E9AE19",
"name": "155396"
},
{
"id": "07A5428127B7E5FB720A96860EC345AD90A74453",
"name": "396667"
}
]
}
}
}
}
Show More
Example 2
Retrieves an exchange by externalProjectId and fileUrn, including filtered property definitions and version info.
Query:
query GetExchangeByFileUrn($externalProjectId: ID!, $fileUrn: ID!) {
exchangeByFileUrn(externalProjectId: $externalProjectId, fileUrn: $fileUrn) {
id
name
propertyDefinitions(filter: {names: ["Volume", "Structural Material"]}) {
results {
id
name
description
}
}
version {
id
versionNumber
}
}
}
Show More
Query Variables:
{
"externalProjectId": "22a5dc47-ca19-4231-9f3e-157ebd4842ff",
"fileUrn": "urn:adsk.wipprod:fs.file:vf.wfjaO3PZSwC2gWg2A1AvbQ"
}
Response:
{
"data": {
"exchangeByFileUrn": {
"id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA",
"name": "SHARE -Multi-Fam Apt-Wing 2",
"propertyDefinitions": {
"results": [
{
"id": "autodesk.revit.parameter:hostVolumeComputed-1.0.0",
"name": "Volume",
"description": "Length x Cross Section Area"
},
{
"id": "autodesk.revit.parameter:structuralMaterialParam-1.0.0",
"name": "Structural Material",
"description": "Specifies a material for the element which will be used in structural analysis."
}
]
},
"version": {
"id": "1685627380181_264ef2b2-1501-34ed-b39e-68f725a9b32f",
"versionNumber": 1
}
}
}
}
Show More
Example 3
Retrieves elements of category ‘Windows’ in an exchange by externalProjectId and fileUrn.
Query:
query GetElementsByExchangeFileUrn($externalProjectId: ID!, $fileUrn: ID!, $elementFilter: ElementFilterInput, $elementPagination: PaginationInput) {
exchangeByFileUrn(externalProjectId: $externalProjectId, fileUrn: $fileUrn) {
id
name
elements(filter: $elementFilter, pagination: $elementPagination) {
pagination {
pageSize
cursor
}
results {
id
name
properties(filter: {names: ["category", "Area"]}) {
results {
name
value
}
}
}
}
}
}
Show More
Query Variables:
{
"externalProjectId": "22a5dc47-ca19-4231-9f3e-157ebd4842ff",
"fileUrn": "urn:adsk.wipprod:fs.file:vf.wfjaO3PZSwC2gWg2A1AvbQ",
"elementFilter": {
"query": "property.name.category==Windows"
},
"elementPagination": {
"limit": 3
}
}
Show More
Response:
{
"data": {
"exchangeByFileUrn": {
"id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA",
"name": "SHARE -Multi-Fam Apt-Wing 2",
"elements": {
"pagination": {
"pageSize": 3,
"cursor": "caed0af3-e3c5-44ab-b5c3-82659b239f50"
},
"results": [
{
"id": "08087FE00C00C0816458C80BFF254ACD74EF8FFC",
"name": "2608023",
"properties": {
"results": [
{"name": "Area", "value": 3.786146883117476},
{"name": "category", "value": "Windows"}
]
}
},
{
"id": "00F20DEBD19DDCE9130ED15C3C4DF92FB01B63DF",
"name": "1175245",
"properties": {
"results": [
{"name": "Area", "value": 6.768324705513875},
{"name": "category", "value": "Windows"}
]
}
},
{
"id": "0196ECCF03B90E022759BCE032CDA0D38050131F",
"name": "1174751",
"properties": {
"results": [
{"name": "Area", "value": 6.768324705513875},
{"name": "category", "value": "Windows"}
]
}
}
]
}
}
}
}
Show More