Queries
exchange
Retrieves a single exchange.
Template for Query:
query GetExchange($exchangeId: ID!) {
exchange(exchangeId: $exchangeId) {
# Exchange Fields
}
}
Template for Query Variables:
{
"exchangeId" : "<SOME-ID-TYPE-SCALAR-VALUE>"
}
Arguments
exchangeId* ID! non-null | The ID of the exchange. |
* Required
Possible Returns
Value Type | Description |
---|---|
Exchange! non-null |
A specific collection of Elements. |
Examples
Example 1
Retrieves an exchange by exchangeId.
Query:
query GetExchange($exchangeId: ID!) {
exchange(exchangeId: $exchangeId) {
id
name
propertyDefinitions(filter: {names: ["Volume", "Structural Material"]}) {
results {
id
name
description
}
}
version {
id
versionNumber
}
}
}
Show More
Query Variables:
{
"exchangeId": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA"
}
Response:
{
"data": {
"exchange": {
"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 2
Retrieves elements of category ‘Windows’ in an exchange by ID
Query:
query GetElementsByExchangeId(
$exchangeId: ID!
$elementFilter: ElementFilterInput
$elementPagination: PaginationInput
) {
exchange(exchangeId: $exchangeId) {
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:
{
"exchangeId": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA",
"elementFilter": {
"query": "property.name.category==Windows"
},
"elementPagination": {
"limit": 3
}
}
Show More
Response:
{
"data": {
"exchange": {
"id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA",
"name": "SHARE -Multi-Fam Apt-Wing 2",
"elements": {
"pagination": {
"pageSize": 3,
"cursor": "f34d348d-03f5-4acf-b138-50fdd8fec206"
},
"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
Example 3
Retrieves all versions of an exchange by exchange ID
Query:
query GetExchange($exchangeId: ID!) {
exchange(exchangeId: $exchangeId) {
id
name
versionHistory {
id
versions{
results{
id
createdOn
}
}
}
}
}
Show More
Query Variables:
{
"exchangeId": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA"
}
Response:
{
"data": {
"exchange": {
"id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA",
"name": "SHARE -Multi-Fam Apt-Wing 2",
"versionHistory": {
"id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjkwMGM5ODY1LWI2ZmMtMzI0Ny04NWUxLTgxMmZhOGY1ZTJkNA",
"versions": {
"results": [
{
"id": "1685627380181_264ef2b2-1501-34ed-b39e-68f725a9b32f",
"createdOn": "2023-06-01T13:50:20.936Z"
}
]
}
}
}
}
}
Show More