HTTP channel

HTTP data clients are designated for real time data publishing or fetching history data.

HTTP client authenticates using a standard Basic Auth and connection is secured by standard TLSv1.2.

HTTP data client's username and password are used to authenticate and publish messages or read raw / historical data acquired by a data account.

Lets pretend we are having data account with root name '1KD87RwQ4tDusX52dOREIG'.

Publishing real time data

HTTP data client publishes data (similar like MQTT data client) to the topic where topic starts with data account root token. Message payload needs to be send as body. Content-type should be any but we recommend to publish as raw text/plain, application/json, application/xml or binary (application/octet-stream).

Raw data endpoint HTTP POST request / publish message POST<<topic>>

cURL Example:

curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -u username:password
-d '[{"bn":"urn:gw1:5","bt":1464306920.392},{"n":"temperature","u":"Cel","v":26.1875}]'

This example will publish message with JSON payload (UTF8) to the data account topic '1KD87RwQ4tDusX52dOREIG/data/temp/gw1/5'

Fetching history data

Raw data endpoint HTTP request for data:


Request parameters

Param Required Description
date yes format YYYYMMDD
limit yes integer (max 1000)
pageCursor no string
format no utf8, json, hex, base64

For complete Raw Data API endpoint documentation check Swagger specification or human readable docs.

Request / response example

HTTP GET request for '1KD87RwQ4tDusX52dOREIG' data account filtered for day '26.5.2016' and specific topic '1KD87RwQ4tDusX52dOREIG/data/temp/gw1/5'.

curl -X GET --header 'Accept: application/json' -u username:password

HTTP JSON response:

  "count": 10,
  "pageCursor": "0000001a0010047b1d70239711e68283937e0705072d00000464617461007ffffff5",
  "data": [
      "time": "2016-05-26T23:55:20.421Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464306920.392},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.1875}]"
      "time": "2016-05-26T23:50:20.380Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464306620.367},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.1875}]"
      "time": "2016-05-26T23:45:20.388Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464306320.357},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.25}]"
      "time": "2016-05-26T23:40:20.375Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464306020.362},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.25}]"
      "time": "2016-05-26T23:35:20.352Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464305720.322},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.1875}]"
      "time": "2016-05-26T23:30:20.383Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464305420.369},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.25}]"
      "time": "2016-05-26T23:25:20.364Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464305120.332},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.1875}]"
      "time": "2016-05-26T23:20:20.369Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464304820.351},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.1875}]"
      "time": "2016-05-26T23:15:20.385Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464304520.357},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.25}]"
      "time": "2016-05-26T23:10:20.359Z",
      "data": "[{\"bn\":\"urn:gw1:5\",\"bt\":1464304220.346},{\"n\":\"temperature\",\"u\":\"Cel\",\"v\":26.25}]"
Parameter Description
count Number of records returned in current fetch.
pageCursor When next page / data is available, pageCursor is present. Add pageCursor to the next request as query string parameter to get next chunk of data.
data Data rows time series. Each row contains time at ISO 8601 format (date and time of data aquisition) and raw data itself.