REST API

Endpoint Time Series service API documentation version v1

{schema}://{host}/api/{version}

  • schema: required (one of http, https - default: http)
  • host: required (string - default: localhost)
  • version: required (v1)

Time series

/time-series/config get

get /time-series/config

Returns configurations of all time series in application(s).

Secured by oauth_2_0 with scopes:
  • application:timeseries-config:read

EPTS supports OAuth 2.0 for authenticating all API requests.

Query Parameters

  • applicationNames: (string)

    Zero or more application name(s). If not specified, data is returned for all available applications.

    Example:

    smart-house, smart-lamp

HTTP status code 200

Map of time series configurations by application name.

Body

Media type: application/json

Type: object

Example:

{
  "smart-house": [
    {
      "name": "temperature",
      "values": ["value"]
    },
    {
      "name": "humidity",
      "values": ["value"]
    }
  ],
  "smart-lamp": [
    {
      "name": "location",
      "values": ["lattitude", "longitude"]
    }
  ]
}

Secured by oauth_2_0

Headers

  • Authorization: (string)

    Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.

Time series data

/applications/{applicationName}/time-series/last get

get /applications/{applicationName}/time-series/last

Returns the most recent time series data.

Secured by oauth_2_0 with scopes:
  • endpoint:read

EPTS supports OAuth 2.0 for authenticating all API requests.

URI Parameters

  • applicationName: required (string)

Query Parameters

  • endpointId: (string)

    Zero or more endpoint ID(s). If not specified, data is returned for all available endpoints.

    Example:

    2ebaf0ab-76f3-4211-a27f-af310be8987f,8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297
  • timeSeriesName: required (string)

    One or more time series name(s).

    Example:

    temperature,humidity

HTTP status code 200

Arrays of most recent data points mapped by time series names and endpoint IDs.

Body

Media type: application/json

Type: object

Example:

{
  "2ebaf0ab-76f3-4211-a27f-af310be8987f": {
    "temperature": [
      {
        "timestamp": "2017-04-20T11:19:57.848Z",
        "values": {
          "value": 20.2,
          "lat": 40.766892,
          "lon": -74.344482
        }
      }
    ],
    "humidity": [
      {
        "timestamp": "2017-04-20T11:19:57.848Z",
        "values": {
          "value": 63,
          "lat": 40.766892,
          "lon": -74.344482
        }
      }
    ]
  },
  "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297": {
    "temperature": [
      {
        "timestamp": "2017-04-20T11:19:57.848Z",
        "values": {
          "value": 23.1,
          "lat": 40.766892,
          "lon": -74.344482
        }
      }
    ],
    "humidity": [
      {
        "timestamp": "2017-04-20T11:19:57.848Z",
        "values": {
          "value": 75,
          "lat": 40.766892,
          "lon": -74.344482
        }
      }
    ]
  }
}

Secured by oauth_2_0

Headers

  • Authorization: (string)

    Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.

/applications/{applicationName}/time-series/data get

get /applications/{applicationName}/time-series/data

Returns historical time series data within the specified time range.

Secured by oauth_2_0 with scopes:
  • endpoint:read

EPTS supports OAuth 2.0 for authenticating all API requests.

URI Parameters

  • applicationName: required (string)

Query Parameters

  • timeSeriesName: required (string)

    One or more time series names.

    Example:

    temperature,humidity
  • endpointId: (string)

    Zero or more endpoint IDs. If not specified, data is returned for all available endpoints.

    Example:

    2ebaf0ab-76f3-4211-a27f-af310be8987f,8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297
  • fromDate: required (datetime)

    ISO-8601 encoded start time to retrieve data points from.

    Example:

    2017-04-20T00:00:00.000Z
  • toDate: required (datetime)

    ISO 8601 encoded end time to retrieve data points to.

    Example:

    2017-04-22T00:00:00.000Z
  • sort: (one of ASC, DESC - default: ASC)

    Sorting order by timestamp.

HTTP status code 200

Array of objects, each contains arrays of most recent data points mapped by time series names and endpoint IDs. The response is returned in chunks. Each chunk is guaranteed to contain an integer number of top-level array elements. The same endpoint ID (and time series name) may occur in several chunks (note an example of that below).

Body

Media type: application/json

Type: array of object

Example:

[
  {
    "2ebaf0ab-76f3-4211-a27f-af310be8987f":{
      "temperature":[
        {
          "timestamp":"2017-04-20T11:19:57.848Z",
          "values":{
            "value":20.2,
            "lat":40.766892,
            "lon":-74.344482
          }
        },
        {
          "timestamp":"2017-04-20T11:20:57.848Z",
          "values":{
            "value":20.7,
            "lat":40.766892,
            "lon":-74.344482
          }
        }
      ],
      "humidity":[
        {
          "timestamp":"2017-04-20T11:19:57.848Z",
          "values":{
            "value":63,
            "lat":40.766892,
            "lon":-74.344482
          }
        }
      ]
    }
  },
  {
    "2ebaf0ab-76f3-4211-a27f-af310be8987f":{
      "temperature":[
        {
          "timestamp":"2017-04-20T11:21:57.848Z",
          "values":{
            "value":20.9,
            "lat":40.766892,
            "lon":-74.344482
          }
        }
      ]
    },
    "8b4aec8a-0a13-4b92-ba0b-0a39cfd5e297":{
      "temperature":[
        {
          "timestamp":"2017-04-20T11:19:57.848Z",
          "values":{
            "value":23.1,
            "lat":40.766892,
            "lon":-74.344482
          }
        },
        {
          "timestamp":"2017-04-20T11:20:57.848Z",
          "values":{
            "value":22.8,
            "lat":40.766892,
            "lon":-74.344482
          }
        }
      ],
      "humidity":[
        {
          "timestamp":"2017-04-20T11:19:57.848Z",
          "values":{
            "value":75,
            "lat":40.766892,
            "lon":-74.344482
          }
        }
      ]
    }
  }
]

Secured by oauth_2_0

Headers

  • Authorization: (string)

    Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.