Query for Assets
The getAssetsForAllBuildingByAboundId
query retrieves all assigned, unassigned, or both types of assets for a building by using the building ID as input. This information can include the asset name, ID, assigned space, and floorplan position. Developers can use this query to map all assigned assets to their respective spaces.
Query Request
From your app or API client, use the below URL:
URL: https://api.abound.carrier.io/prod-ahs-api/graphql/
Argument: The arguments for getAssetsForAllBuildingByAboundID
are:
aboundId
- This is the ID of the building and can be obtained from the previous step using thegetNodeByType
query.assigned
- User can specify assigned, unassigned, or all assets that are assigned to spaces in the building are returned.
Query Response
As a response, the above query will fetch details about various assets for the entire building based on the specified AboundId.
QUERY
{
getNodeByType(type: Building) {
id
name
address {
street
city
state
}
hasPart {
space {
id
name
brickClass
hasPart {
space {
id
name
}
}
}
}
}
}
RESPONSE
{
"data": {
"getNodeByType": [
{
"id": "d3f2a1b6",
"name": "Building A",
"address": {
"street": "123 Main St",
"city": "Springfield",
"state": "IL"
},
"hasPart": [
{
"space": {
"id": "f8e2b3c4",
"name": "First Floor",
"brickClass": "Floor",
"hasPart": [
{
"space": {
"id": "a9c8b7d6",
"name": "Office 101"
}
},
{
"space": {
"id": "b2a1c3d4",
"name": "Conference Room 102"
}
}
]
}
}
]
}
]
}
}