Using the OpenAPI 3 Specification
The SmartBuildings API follows the OpenAPI 3.0 Specification (OAS3). The specification file for the API can be downloaded at https://api.sb.ecobee.com/docs/openapi.json.
OpenAPI Codegen
One way to get started with the API is to generate an SDK via an OpenAPI Generator.
Documentation for the generator can be found at: https://github.com/OpenAPITools/openapi-generator.
Code Generation Example
Here is an example of how you can generate and use a generated SDK with the SmartBuildings API.
This example generates a javascript SDK, however there are a wide variety of language generators available.
npm install -g @openapitools/openapi-generator-cli
openapi-generator -g javascript -i https://api.sb.ecobee.com/docs/openapi.json
In this case, a node package will be scaffolded containing the API SDK, along with a basic test infrastructure for it. This can then be packaged as normal and used in any other javascript application.
Please see the OpenAPI Generator documentation for more information on generating code for other languages.
Updated over 4 years ago