Climaps API  version 1
Static Public Member Functions | List of all members
filters Class Reference

Static Public Member Functions

static createOwnFilter ()
 
static deleteOwnFilter ()
 
static getContent ()
 
static getExtendedContent ()
 
static getOwnFilters ()
 
static setOwnFilterContent ()
 

Static Public Attributes

static FILTERID_MY_STATIONS = 0
 Filter containing all the stations the current can view or modify.
 
static FILTERID_PUBLIC_STATIONS = 1
 Filter containing all the public stations (i.e., that anyone can view)
 

Detailed Description

This class lets you manipulate the filters of the current user.

Filters are just a list of stations on which the current user has at least the view permission, including public stations. With filters you can have a view on a subset of stations instead of seeing all of them at once.

Member Function Documentation

static filters::createOwnFilter ( )
static

Create a new filter for the current user.

Parameters
stringstationsIdA comma-separated list of stations Id (e.g., "650,612,1033")
stringnameFilter name
Returns

An object such as:

Property Type Description
success boolean Whether the filter could be created
error string Error message in case of failure
static filters::deleteOwnFilter ( )
static

Delete a filter of the current user.

Parameters
intfilterIdFilter id
Returns

An object such as:

Property Type Description
success boolean Whether the filter could be deleted
error string Error message in case of failure
static filters::getContent ( )
static

Get the list of stations of a given filter.

Parameters
intfilterIdFilter id
Returns

An array of objects such as:

Property Type Description
id int Station id
name string Station name
Note
The array is sorted by station id, smallest first
static filters::getExtendedContent ( )
static

Get the list of stations of a given filter, plus additional information.

Parameters
intfilterIdFilter id
intnotOlderThanDeadline for data in seconds, older data is ignored (set to 0 to remove age restriction)
Returns

An object with stations indexed by their id such as:

Property Type Description
id Station Extended station data

The stations are objects such as:

Property Type Description
id int Station id
name string Station name
lat float Latitude
lng float Longitude
type int Type of the station (e.g., stations::STATION_TYPE_DS3_MASTER)
epochActivity int Epoch time of the most recent activity
epochSensor int Epoch time of the most recent sensor data
battery float Most recent battery level reported
public boolean Whether the station is publicly accessible
modifiable boolean Whether the current user has "modify" permission on the station
static filters::getOwnFilters ( )
static

Get the filters of the current user.

Returns

An array of objects such as:

Property Type Description
id int Filter id
name string Filter name
nbStations int Number of stations in the filter
Note
The array is sorted alphabetically by filter name
static filters::setOwnFilterContent ( )
static

Set the content of an existing filter of the current user.

Parameters
intfilterIdFilter id
stringstationsIdA comma-separated list of stations Id (e.g., "650,612,1033")
stringnameFilter name
Returns

An object such as:

Property Type Description
success boolean Whether the filter could be updated
error string Error message in case of failure