Create measurement

Create a new measurement entry.

URI
/measurement/create/{nodeKey}/{fieldName}/{value}
Method
GET

URI parameters

nodeKey
The node key
fieldName
The field name
value
The float value

Request headers

Request body

Response body

200 The saved measurement
{  
   "epoch":17910,
   "nodeId":"7c8f4bb0-17eb-11e9-9ca3-f719d74fca9a",
   "field":"teszt",
   "created":"870d9b00-17eb-11e9-b2c0-591f3111d72f",
   "floatValue":21.0,
   "textValue":null
}
404 Node key not found or field of node not exists

                            

Delete raw measurement data

Delete raw measurement data by epoch and range of UTC timestamp of milliseconds.

URI
/measurement/delete/{epoch}/{nodeShortId}/{fieldName}/{fromTimestamp}/{toTimestamp}
Method
GET

URI parameters

epoch
The epoch of day
nodeShortId
The short id of the node
fieldName
The field name
fromTimestamp
Inclusive UTC timestamp in milliseconds
toTimestamp
Exclusive UTC timestamp in milliseconds

Request headers

Authorization
Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The removed measurement entries
[{  
   "epoch":17910,
   "nodeId":"7c8f4bb0-17eb-11e9-9ca3-f719d74fca9a",
   "field":"teszt",
   "created":"870d9b00-17eb-11e9-b2c0-591f3111d72f",
   "floatValue":21.0,
   "textValue":null
}]
403 Access forbidden to the node

                            
404 Node key not found or field of node not exists

                            

List raw measurement data

List raw measurement data by epoch and range of UTC timestamp of milliseconds.

URI
/measurement/list/{epoch}/{nodeShortId}/{fieldName}/{fromTimestamp}/{toTimestamp}
Method
GET

URI parameters

epoch
The epoch of day
nodeShortId
The short id of the node
fieldName
The field name
fromTimestamp
Inclusive UTC timestamp in milliseconds
toTimestamp
Exclusive UTC timestamp in milliseconds

Request headers

Authorization
Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The list of measurement entries
[{  
   "epoch":17910,
   "nodeId":"7c8f4bb0-17eb-11e9-9ca3-f719d74fca9a",
   "field":"teszt",
   "created":"870d9b00-17eb-11e9-b2c0-591f3111d72f",
   "floatValue":21.0,
   "textValue":null
}]
403 Access forbidden to the node

                            
404 Node key not found or field of node not exists

                            

Load raw measurements by epoch

Load raw values by epoch, node id, field name.

URI
/measurement/loadByEpoch/{epoch}/{nodeShortId}/{fieldName}
Method
GET

URI parameters

epoch
The elapsed days (epoch) from 1 January, 1970
nodeShortId
The short id of the node
fieldName
The field name

Request headers

Request body

Response body

200 The saved measurement
[  
   [  
      1546894398360,
      15.0
   ],
   [
      ...,
      ...
   ],
   [  
      1546894372542,
      15.0
   ]
]
404 Node key not found or field of node not exists

                            

Load measurement series by granulation

Load series of values by node id, field name, granulation and number of series.

URI
/measurement/loadByNodeId/{nodeShortId}/{fieldName}/{granulation}/{numberOfSeries}
Method
GET

URI parameters

nodeShortId
The short id of the node
fieldName
The field name
granulation
The granulation of the aggregation of the series:
  • DAY: 5 minutes aggregation per series
  • WEEK: 1 hour aggregation per series
  • MONTH: 4 hours aggregation per series
  • YEAR: 1 day aggregation per series
numberOfSeries
Number of series to now

Request headers

Request body

Response body

200 The array of series (timestamp, average, minimum, maximum) with meta data of node and field.
[  
   {  
      "field":"temp",
      "data":[  
         [  
            1547561700000,
            20.4,
            20.4,
            20.4
         ],
         [
            ...,
            ...,
            ...,
            ...
         ], 
         [  
            1547475900000,
            20.8,
            20.8,
            20.8
         ]
      ],
      "name":"room — temp",
      "description":"room"
   }
]

Load measurement series by granulation

Load series of values by node key, field name, granulation and number of series.

URI
/measurement/loadByNodeKey/{nodeKey}/{fieldName}/{granulation}/{numberOfSeries}
Method
GET

URI parameters

nodeKey
The node key
fieldName
The field name
granulation
The granulation of the aggregation of the series:
  • DAY: 5 minutes aggregation per series
  • WEEK: 1 hour aggregation per series
  • MONTH: 4 hours aggregation per series
  • YEAR: 1 day aggregation per series
numberOfSeries
Number of series to now

Request headers

Request body

Response body

200 The array of series (timestamp, average, minimum, maximum) with meta data of node and field.
[  
   {  
      "field":"temp",
      "data":[  
         [  
            1547561700000,
            20.4,
            20.4,
            20.4
         ],
         [
            ...,
            ...,
            ...,
            ...
         ], 
         [  
            1547475900000,
            20.8,
            20.8,
            20.8
         ]
      ],
      "name":"room — temp",
      "description":"room"
   }
]

Load the last float value

Load last one float value of the node key and field name.

URI
/measurement/loadLastFloatValue/{nodeKey}/{fieldName}
Method
GET

URI parameters

nodeKey
The node key
fieldName
The field name

Request headers

Request body

Response body

200 The last float value of the node key and field name.
23.21
404 Node key not found or field of node not exists

                            

Load the last 'n' float values

Load last n (max 25) float values of the node key and field name in the last 1 hour.

URI
/measurement/loadLastFloatValues/{nodeKey}/{fieldName}/{items}
Method
GET

URI parameters

nodeKey
The node key
fieldName
The field name
items
number of items (max 25)

Request headers

Request body

Response body

200 The list of pairs of last float value and timestamps of the node key and field name.
[[1557155484,23.21],[1557155484,23.22]]
404 Node key not found or field of node not exists

                            

Load the last measurement

Load last one measurement of the node key and field name in the last 15 minutes.

URI
/measurement/loadLastMeasurement/{nodeKey}/{fieldName}
Method
GET

URI parameters

nodeKey
The node key
fieldName
The field name

Request headers

Request body

Response body

200 The last float value of the node key and field name.
{  
   "epoch":18024,
   "nodeId":"a00dd860-6dde-11e9-a695-b7d293bdfcf9",
   "field":"temperature",
   "created":"a05ae470-71a3-11e9-812c-dd0071b4b3ce",
   "floatValue":16.4
}
404 Node key not found or field of node not exists