Properties active and started have been added to the segment object to the /devices and /locations endpoints. The active field is used to distinguish between devices that are currently paired to an account and devices that have been unpaired and removed from the account, but still have historical measurements.
The segment object now has the following structure:
The webhooks will now receive an event when a new mold risk indicator value is calculated. The event type will be airthings-webhook-cloudevent-virtual-sample-feed for these samples.
The website has been updated with swagger documentation, the swagger was previously hosted in accounts.airthings.com. It can now be found here: API documentation.
Over the last few months we have been iterating the Airthings REST API together with our passionate early users. We have received a lot of valuable feedback and implemented updates accordingly.
With this release we are graduating the Airthings REST API from Beta. The motivation for the changes in this update is to improve consistency and usability of the API. We do not foresee any more breaking changes, and potential future breaking changes will result in a version update of the API.
The Swagger documentation has been updated to reflect these changes. Play with the new version, and download it here. (API documentation will be updated as well).
The API will be updated on 2019-11-25.
We hope that the changes do not cause you any inconvenience. Please reach out to Airthings for Business Support for any clarifications or with any questions.
✨ Improvements
Planned changes (swagger-diff):
new endpoints for getting location and latest sample of all devices in a location
get /locations/{}
get /locations/{}/latest-samples
new response attributes
get /devices
new attribute in response: segment/id (in: body, type: string)
new attribute in response: segment/name (in: body, type: string)
new attribute in response: location/id (in: body, type: string)
new attribute in response: location/name (in: body, type: string)
get /devices/{}
new attribute in response: segment/id (in: body, type: string)
new attribute in response: segment/name (in: body, type: string)
new attribute in response: location/id (in: body, type: string)
new attribute in response: location/name (in: body, type: string)
get /locations
new attribute from response: locations[]/name (in: body, type: string). This replaces removed attribute locations[]/locationName
get /segments
new attribute in response: segments[]/deviceId (in: body, type: string). This replaces removed attribute segments[]/serialNumber
new attribute in response: location/id (in: body, type: string)
new attribute in response: location/name (in: body, type: string)
Example GET /segments endpoint:
locationName is replaced by an object.
serialNumber is deviceId.
The old vs. new response from the GET /segments endpoint:
The developer documentation has been updated with tutorials on how to use the Airthings API. This includes two guides on how to fetch your Airthings data using either python or node.js and a guide for setting up an automatic SMS messaging service by combining Twillio and Airthings webhooks. The former two guides will help you register your application and provide a starting point for developing an Airthings integrated solution, whereas the latter guide can be utilized to send SMS notifications in the case a threshold value is breached, such as high radon levels or high temperatures.