Child pages
  • Webservice API
Skip to end of metadata
Go to start of metadata

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
RelayID
SensorType WithinMetersFrom

Query Latest Sensor Readings

GET /Query/Latest/100.csv

GET

Query/TimestampRange

start/end (UNIX time in seconds)

SensorID
RelayID
SensorType WithinMetersFrom

Query Readings between timestamp range 

GET /Query/TimestampRange/1318711900/1319119800.txt

GET

Query/DateRange

start/end (YYYYMMDD - ISO Date Format)

SensorID
RelayID
SensorType WithinMetersFrom

Query Readings in date range

GET /Query/DateRange/20111001/20111005.csv 

GET

Query/Relays

 

 

List of Relays

GET /Query/Relays.txt

GETQuery/Sensors  List of SensorsGET /Query/Sensors.csv
GETAggregate/Average/DateRange

start/end/interval (YYYYMMDD - ISO Date Format, interval in minutes)

SensorID
RelayID          SensorType

Shows the mean average of numerical data for each sensor subdivided by interval from a given date rangeGET /Aggregate/Average/DateRange/20111225/20121230/60.table.html
GETAggregate/Average/TimestampRange

start/end/interval (UNIX time in seconds, interval in minutes)

SensorID
RelayID         SensorType

Shows the mean average of numerical data for each sensor subdivided by interval from a given timestamp rangeGET Aggregate/SumVolume/TimestampRange/1318711900/1319119800/60.table.html
GETAggregate/Sum/DateRange

start/end/interval (YYYYMMDD - ISO Date Format, interval in minutes)

SensorID
RelayID       SensorType

Shows the sum of numerical data of each sensor subdivided by interval from a given timestamp rangeGET /Aggregate/AvgTemp/DateRange/20111225/20121230/60.table.html
GETAggregate/Sum/TimestampRange

start/end/interval (UNIX time in seconds, interval in minutes)

SensorID
RelayID       SensorType

Shows the sum of numerical data of each sensor subdivided by interval from a given date rangeGET 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.xmltxtcsvtable.html
SensorSUPPORTEDSUPPORTEDSUPPORTEDSUPPORTED
QueryUNSUPPORTEDSUPPORTEDSUPPORTEDSUPPORTED
AggregateUNSUPPORTEDSUPPORTEDSUPPORTEDSUPPORTED

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.

ConverterValid ArgumentsDescription
UnitsMetric/StandardConverts units between metric and standard (Default: metric)
TimezoneEST5EDT, CST, UTC, etc.Converts time fields to other time
  • No labels