Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Api Home

Patrick Holmes edited this page Jul 24, 2014 · 33 revisions

This API represents an external service for interacting with the enableiot.com system

API Authorization

Nearly all of the REST methods require an access token. There are two types of access tokens:

  1. Device token - this token is assigned to a device (client) when it activates the device. The token has very limited permissions such as enabling the device to create time series (register components) and to send observations for only those time series.

  2. User token - this token is derived using a user's credentials. The token enables access to the user resource, the account resources associated with the user, device resources associates with those account resources, etc.

Note: User tokens are very powerful. Treat user tokens just as you would treat a password.

####Authorization Header For REST methods which require an access token, the token must be sent using the HTTP 'Authorization' header, like this:

Authorization: Bearer<space><token>

For example:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9....

API Root

API entry point.

/v1/api

Note, while the individual messages are versioned, the entire API version will need to change when message changes result endpoint incompatibility.

Data Structure

    Domain
      +---Users
      |
      +---Devices
          |
          +---Components (a component is a Metric or Actuator)
             |
             +---Metrics
             |
             +---Actuators 
Object Definition
Domain A logic organization that groups a universe of Devices, and allows one or more users with common interests to manage these devices.
User A human who interacts with the system though the UI. Users can have different roles.
Component Capable of outputting data. Each Component has a globally unique identifier cid and a user-defined label name, which is unique only in the namespace of the same device. Also, the component has a type and other attributes taken from the components catalog. A component can be either a metric or an actuator.
Metric (sensor) Represents a series of values obtained from a specific sensor. Examples: temperature, humidity, wind speed, geographic coordinates, sound waveforms, images
Actuator Represents a setting which can be modified on a device, typically resulting in physical response. Examples: turn on a LED, open a valve, capture an image. The actuator can change the setting and/or output its current state.
Device A physical object containing zero or more components. The components can be an integral part of the device or external objects that use the device as a hub. A device does not necessarily have a route to the cloud. Each Device has a globally unique identifier deviceId.
Gateway A device which also has a route to the cloud. The gateway can route messages from other (non-gateway) devices to and from the cloud. Each Gateway has a globally unique identifier gatewayId (which is identical to its deviceId).

API Services

CRUD or create, read, update and delete, represents a set of basic functionality on an model identity.

Clone this wiki locally