SensLog API is still being developed and range of services is extending. Last update of the SensLog contains service for inserting new Units with Sensors by user. This service is especially suitable for scenario “collecting data by smartphones”, it enables register new smartphone before starting of collecting data.
Management Service
ManagementService allows user to register unit with sensors.
URL | ||
---|---|---|
/ManagementService?Operation=operationName |
||
Method | Functionality | Format |
POST | Provides registration of new components of sensor network | JSON |
InsertUnit
URL | ||
---|---|---|
/ManagementService?Operation=InsertUnit | ||
Method | Functionality | Format |
POST | Provides insertion of new unit with sensors into database. Returns JSON description of the unit with IDs of unit, sensors and phenomenons. | JSON |
Example of InsertUnit payload
{
"unit":{
"description":"test insert unit"
},
"sensors":[
{
"sensor_name":"test sensor1",
"sensor_type":"testing sensor",
"phenomenon":{
"phenomenon_name":"testing phenomenon 1",
"uom":"rounds"
}
},
{
"sensor_name":"test sensor 2",
"sensor_type":"testing sensor",
"phenomenon":{
"phenomenon_name":"testing phenomenon 2",
"uom":"points"
}
}
]
}
Second update is a new service for getting last observations of unit or group of units.
SensorService
GetLastObservations
URL | ||
---|---|---|
/SensorService?Operation=GetLastObservations | ||
Method | Functionality | Format |
GET | Provides last observations of specified unit or group of units. Returns JSON with observations. | JSON |
Parameter | Format | Role |
---|---|---|
group | Textual value | Name of group of units (optional), alone or with sensor_id |
unit_id | Numerical value | Identifier of unit (optional), alone or with sensor_id |
sensor_id | Numerical value | Identifier of sensor (optional) |
GetLastObservations – allowed combinations
- &group=
- &group=&sensor_id=
- &unit_id=
- &unit_id=&sensor_id=