BigSense Web Service REST API
Function Matrix
Methods | Action | Arguments | Constraints | Description | Example |
---|---|---|---|---|---|
GETPOST | Sensor | package_id (GET only) |
| Read/Write Sensor Packages | POST /Sensor.sense.xml GET /Sensor/15.sense.xml |
GET | Query/Latest | limit (required) | SensorID | Query Latest Sensor Readings | GET /Query/Latest/100.csv |
GET | Query/TimestampRange | start/end (UNIX time in seconds) | SensorID | Query Readings between timestamp range | GET /Query/TimestampRange/1318711900/1319119800.txt |
GET | Query/DateRange | start/end (YYYYMMDD - ISO Date Format) | SensorID | Query Readings in date range | GET /Query/DateRange/20111001/20111005.csv |
GET | Query/Relays |
|
| List of Relays | GET /Query/Relays.txt |
GET | Query/Sensors | List of Sensors | GET /Query/Sensors.csv | ||
GET | Aggregate/Average/DateRange | start/end/interval (YYYYMMDD - ISO Date Format, interval in minutes) | SensorID | Shows the mean average of numerical data for each sensor subdivided by interval from a given date range | GET /Aggregate/Average/DateRange/20111225/20121230/60.table.html |
GET | Aggregate/Average/TimestampRange | start/end/interval (UNIX time in seconds, interval in minutes) | SensorID | Shows the mean average of numerical data for each sensor subdivided by interval from a given timestamp range | GET Aggregate/SumVolume/TimestampRange/1318711900/1319119800/60.table.html |
GET | Aggregate/Sum/DateRange | start/end/interval (YYYYMMDD - ISO Date Format, interval in minutes) | SensorID | Shows the sum of numerical data of each sensor subdivided by interval from a given timestamp range | GET /Aggregate/AvgTemp/DateRange/20111225/20121230/60.table.html |
GET | Aggregate/Sum/TimestampRange | start/end/interval (UNIX time in seconds, interval in minutes) | SensorID | Shows the sum of numerical data of each sensor subdivided by interval from a given date range | GET Aggregate/AvgTemp/TimestampRange/1318711900/1319119800/60.table.html |
Formats
- SenseData XML (sense.xml): Only used in transmitting data from the client to the server. Includes timezone, sensor information and can contain multiple packets
- TABLE.HTML: A human readable, sortable HTML table that can be viewed in a web browser
- TXT: Tab Delimited flat data format
- CSV: Coma Separated flat data format
Action | agra.xml | txt | csv | table.html |
---|---|---|---|---|
Sensor | SUPPORTED | SUPPORTED | SUPPORTED | SUPPORTED |
Query | UNSUPPORTED | SUPPORTED | SUPPORTED | SUPPORTED |
Aggregate | UNSUPPORTED | SUPPORTED | SUPPORTED | SUPPORTED |
Constraints
Some query functions support constraints passed at GET parameters
- SensorID: Restricts results by Sensor Unique Identifier
- RelayID: Restricts results by Relay Unique Identifier
- SensorType: Restricts results by Sensor Type
- WithinMetersFrom: Restricts results to within a radius (in meters) of a specific longitude, latitude.
- The following example shows a restriction from within 1 kilometre of longitude 34.6 and latitude 96.543
- http://localhost/Query/Latest/100.txt?WithinMetersFrom=34.6long96.543lat1000r
Example:
http://localhost/Latest/200.txt?SensorType=Temperature&RelayID=4-Paver1
Converters
Query functions also support conversions that are passed as GET parameters similar to constraints.
Converter | Valid Arguments | Description |
---|---|---|
Units | Metric/Standard | Converts units between metric and standard (Default: metric) |
Timezone | EST5EDT, CST, UTC, etc. | Converts time fields to other time |