improved
API - Hiding unpaired devices in responses by default
March 7th, 2021
✨ Improvements
We have received some feedback about unpaired/retired devices being returned by our endpoints.
Having old devices in the response makes it harder to know if a device in the response is active in an account or not.
To address this we added a new default to hide segments and devices due to unpaired or decommissioned devices from the following endpoints:
/devices
/segments
/locations/{locationId}
Getting old segments of unpaired devices and unpaired devices can still be done by providing the query parameter: showInactive=true
Consider the following response from the /devices
endpoint, the device 2930002398 has been decommissioned,
hence its segment is active=false
, it is only returned by the endpoint, when the query parameter showInactive=true
is present.
{
"devices": [
{
"id": "2930000351",
"deviceType": "WAVE_PLUS",
"sensors": [
"radonShortTermAvg",
"temp",
"humidity",
"pressure",
"co2",
"voc",
"light",
"virusRisk"
],
"segment": {
"id": "6b761d0e-c1a4-4607-b52b-2ae6e4320e29",
"name": "Hardware Area",
"started": "2018-11-19T16:51:51",
"active": true
},
"location": {
"id": "0a4fa775-1bed-455b-b1b1-b91d40df667b",
"name": "Airthings HQ - Oslo"
}
},
{
"id": "2930002398",
"deviceType": "WAVE_PLUS",
"sensors": [
"radonShortTermAvg",
"temp",
"humidity",
"pressure",
"co2",
"voc",
"light",
"virusRisk"
],
"segment": {
"id": "d36a7733-bac9-47af-b8af-094da015e41f",
"name": "NOx - Meeting Room",
"started": "2018-12-06T14:46:06",
"active": false
},
"location": {
"id": "0a4fa775-1bed-455b-b1b1-b91d40df667b",
"name": "Airthings HQ - Oslo"
}
}
]
}