Skip to main content

Getting Started with the REST API

The Echolo REST API is the main interface to the entire platform; it allows for complete management and insight into your end devices and communication hubs. The following is a "Quick Start Guide" to help you get up and running, so let's get started!

First: Be sure to have a look at the Swagger API Docs

A special note before moving on

All requests to the Echolo REST API require using a unique API key named x-api-key. This key is inserted into the request as a header and should be present for all authenticated and non-authenticated requests.

JSON
{
  "message": "Forbidden"
}

The error means that you did not include the x-api-key as a header in your request OR that the key is no longer valid.

API Versions

Before moving forward, please check the current API version here.


Authentication

Before moving on, please review the Authentication Guide. Make sure to review the token expiration and request example.

Request Data

In the example below, we will request all `Hubs` registered to the application through appId. We will use the hub path /hub with our newly created token to get all hubs.

JS
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.echolo.io/v2/hub',
  headers: 
   { 'x-api-key': 'x-api-key',
     token: 'token',
     'app-id': 'app-id' } }; // NOTE: app-id header has changed to appId in API v3

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Application ID Header:
When using v3 of the API please make sure to use appId vs app-id.

Response

If your application has registered hubs, an Array of all hubs will be returned. If your application does not have registered hubs, an empty Array will be returned.

JSON
[
  {
    "hubId":"echolo-hub-0",
    "appId":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "lastSeenDate":"Mon Mar 12 2018 19:40:17 GMT+0000 (UTC)",
    "key":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "environment": "String",
    "sku": "String",
    "mfgSn": "String"
  },{
    "hubId":"echolo-hub-1",
    "appId":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "lastSeenDate":"Mon Feb 26 2018 03:02:22 GMT+0000 (UTC)",
    "key":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "environment": "String",
    "sku": "String",
    "mfgSn": "String"
  },{
    "hubId":"echolo-hub-2",
    "appId":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "lastSeenDate":"Mon Feb 26 2018 03:06:31 GMT+0000 (UTC)",
    "key":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
    "environment": "String",
    "sku": "String",
    "mfgSn": "String"
  }
]

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.