Custom Stream Data Source Documentation

Read

A dataset can be queried through a HTTP GET request with Basic Authentication.

General Parameters:

  • path (required): the id of the dataset to be read.
  • limit: a limit on the number of data points to be returned. In this case, data points are counted from the most recent ones.

Filtering Parameter:

A reading request can be refined using filtering parameters over the fields of data points contained in the specified dataset. There’s no limit to the number of filters that can be applied. Filters are applied in a cascade fashion (i.e. they are connected by a logic AND). Every filter is identified by two parameters: a field name (i.e. fField) over which the filter is applied, and a comparator (e.g. gt – “greater than”), whose associated value is the fField field value against which to compare. A numerical integer index is used to pair the field name with the related comparator, e.g. fField1 and gt1.  
  • fFieldN: the name of the field over which the N-th filter must be applied.
  • gtN: greater-than comparison operator.
  • getN: greater-or-equal-than comparison operator.
  • ltN: less-than comparison operator.
  • letN: less-or-equal-than comparison operator.
  • equalsN: equals-to comparison operator.
  • difN: different-from comparison operator.

Authentication

HTTP Basic Authentication is required to read a dataset, with the following credentials:  
  • username: the user key associated with the selected dataset
  • password: empty

Examples:

Simple access to a dataset with no filters Reading the 100 most recent data points Read request with one filter on the sensorid field. The value of sensorid must be equal to the value 303. Read request with two filters. One on the sensorid field, which must be equal to the value 303, and one on the value field, which must have a value greater than 0.5.

Write

The operation of appending a JSON to a dataset if performed through a HTTP POST request with Basic Authentication. Differently from the Read action, the dataset where to append the JSON is specified here directly in the URL of the request. The JSON is instead passed as a parameter.

General Parameters:

  • json (required): the JSON string to be appended. It must contain a field named timestamp containing the data point timestamp expressed in milliseconds.

Authentication

HTTP Basic Authentication is required to read a dataset, with the following credentials:
  • username: the user key associated with the selected dataset
  • password: empty

Examples: