Getting Started

The Green Stack REST API is a powerful toolset that empowers innovative and creative minds to create building management solutions on top of the Green Stack platform. This section walks through the API usage, responses, and endpoints.

The API is crafted around REST and the REST architectural style to provide developers with a stateless and language-­agnostic interface. The API leverages common HTTP verbs and response codes, OAuth2 authentication, and resource­ oriented URLs.

Currently, the API only supports JSON. All POST/PUT requests required a valid JSON object for the request body.

Access to the REST API requires the api feature set

API Host

The root API host is https://api.greenstack.cloud/

The API is only available via HTTPS

API Endpoints

The API endpoints available are documented in an Open API spec at https://api.greensack.dev/v1

Authentication

The authentication required for each endpoint varies, but in general, most endpoints will require some form of authentication. There are two ways to provide authentication.

API Keys

An API key is passed in the X-Green-Stack-Key header to authenticate a request.

X-Green-Stack-Key: dgf...euhsdf

Generating an API Key

Step 1 - Login to the Green Stack Console

Step 2 - Navigate to Engineering Mode

Step 3 - Select the API Keys tab

Step 4 - Click New Key to create a new API key

Step 5 - Provide a Name for the new key and select the desired permissions

Step 6 - Click Save to generate the key

Access Token

To authenticate with a token, add an Authorization header with a valid Bearer token.

Authorization: Bearer eyJg...fw5c

Obtaining an Access Token

Follow these steps to obtain an access token for use with these docs:

  1. Login to the Green Stack Console
  2. In the console menu, click your photo to access your account details
  3. Scroll down to the Access Token section
  4. Click Copy Token to copy your access token to your clipboard