Overview

The Verdigris API allows for fetching of data collected by buds in the Verdigris ecosystem.

Current Version

The current version of the api is v1.

Schema

The API is accessed over HTTPS. Data is sent and received as JSON.

$ curl -i https://app.verdigris.co/api/v1/circuits/1765/ -H "Authorization: Token token=<access token>"

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-UA-Compatible: IE=Edge
ETag: "49b05155de16533ba33ccfb83701cb56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 1bcb71d68614fd959197233ba8c78272
X-Runtime: 0.069054
Set-Cookie: __profilin=p%3Dt%2Cdp%3Dt; path=/
Connection: close
Server: thin 1.6.1 codename Death Proof

{"circuit":{"id":1765,"name":"NASA Ames Building 19 Room 1001","active":true,"breaker_size":20,"tag_names":["Office"],"panel_id":169}}


Client Errors

  1. Authentication Error

    A valid access_token must be provided in the Authorization headers.

    HTTP/1.1 404 Not Found
    {"error":"Couldn't find ApiKey with access_token = <invalid access_token>"}
  2. Resource Error

    This error could be due to the fact that the resource requested is not accessible by the access_token specified.

     HTTP/1.1 404 Not Found
     {"error":"Couldn't find Circuit with id=<circuit_id> [WHERE "memberships"."user_id" = <user_id>]"}


Authentication

The only way to authenticate with the API is to pass in an Authorization http header as shown in the example below:

$ curl -i https://app.verdigris.co/api/v1/circuits/1765/ -H "Authorization: Token token=<access token>"


Data Expiration Schedule

Interval: Availability
minutely: 1 day
15 minutely: 45 days
hourly: 60 days (~ 2 months)
daily: 1440 days (~ 4 years)

Resources

Buildings

Resource Description
GET /api/v1/buildings List buildings
GET /api/v1/buildings/:id Show a building
GET /api/v1/buildings/:building_id/power Power data for a building
GET /api/v1/buildings/:building_id/energy Energy data for a building

Circuits

Resource Description
GET /api/v1/circuits List circuits
GET /api/v1/circuits/:id Show a circuit
GET /api/v1/circuits/:circuit_id/power Power data for a circuit
GET /api/v1/circuits/:circuit_id/energy Energy data for a circuit

Panels

Resource Description
GET /api/v1/panels List panels
GET /api/v1/panels/:id Show a panel
GET /api/v1/panels/:panel_id/power Power data for a panel
GET /api/v1/panels/:panel_id/energy Energy data for a panel