CommonSense PHP API Library
Api Class Reference

List of all members.

Public Member Functions

 api ($server="")
 getSessionId ()
 setSessionId ($sessionid)
 getErrorLog ()
 login ($username, $password, $md5_used=false)
 oauthLogin ($key, $secret)
 logout ()
 listDevices ()
 readDevice ($id)
 readDeviceSensors ($id, $page, $perPage, $details)
 addEnvironment ($name, $floors, $gps_outlines, $position)
 deleteEnvironment ($id)
 listEnvironments ()
 readEnvironment ($id)
 updateEnvironment ($id, $name)
 listGroups ()
 createGroup ($email, $name, $username, $password)
 createGroupFromArray ($data)
 readGroup ($id)
 updateGroup ($id, $email, $username, $password, $name)
 deleteGroup ($id)
 listUsersOfGroup ($id)
 addUserToGroup ($id, $userID, $userName)
 listSensors ($page, $perPage, $shared, $owned, $physical, $group_id=-1)
 createSensor ($name, $displayName, $deviceType, $pagerType, $dataType, $dataStructure)
 createTrigger ($name, $expression, $inactivity=NULL)
 addSensorTrigger ($sensor_id, $trigger_id)
 updateSensorTrigger ($sensor_id, $trigger_id, $active=0, $last_sensor_data_value="", $last_sensor_data_date=0)
 addSensorTriggerNotification ($sensor_id, $trigger_id, $notification_id)
 listTriggers ()
 listSensorTriggers ($sensor_id)
 createNotification ($type, $text, $destination)
 listNotifications ()
 readSensor ($id)
 updateSensorDescription ($id, $name, $displayName, $deviceType, $pagerType, $dataType, $dataStructure)
 deleteSensor ($id)
 listSensorData ($id, $page=-1, $perPage=-1, $startDate=0, $endDate=0, $date=0, $next=0, $last=0, $sort= 'DESC', $total=NULL, $interval=0)
 updateSensorSpecificData ($id, $value, $date)
 deleteSensorData ($sensorID, $dataID)
 getFileLocation ($sensorID, $dataID)
 deleteFile ($sensorID, $dataID)
 deleteAllFiles ()
 uploadSensorData ($json)
 readSensorEnvironment ($id)
 addSensorsToEnvironment ($id, $sensorIds)
 addSensors ($group_id, $sensor_ids)
 listEnvironmentSensors ($id)
 removeSensorFromEnvironment ($environmentID, $sensorID)
 readParentDevice ($sensorID)
 addToParentDevice ($sensorID, $deviceID, $type, $uuid)
 removeFromParentDevice ($sensorID)
 sharredUsers ($sensorID)
 addSharredUser ($sensorID, $userID, $username)
 removeSharredUser ($sensorID, $userID)
 listConnectedSensors ($sensorID)
 connectSensor ($sensorID, $connectedSensorID)
 removeConnectedSensor ($sensorID, $connectedSensor)
 listRunningServices ($sensorID)
 listAvailableServices ($sensorID)
 useService ($sensorID, $json)
 disconnectFromService ($sensorID, $serviceID)
 listServiceMethods ($sensorID, $serviceID)
 runServiceGetMethod ($sensorID, $serviceID, $method)
 runServiceSetMethod ($sensorID, $serviceID, $method, $parameters)
 learnPattern ($SensorID, $serviceID, $startData, $endDate, $label)
 listAllAvailableServices ()
 listAllUsers ($page, $perPage)
 createUser ($email, $username, $name, $surname, $mobile, $password)
 readUser (int $userID)
 updateUser ($userID, $email, $username, $name, $surname, $mobile, $password)
 deleterUser ($userID)
 readCurrentUser ()
 listMetaTags ($details=NULL, $namespace=NULL, $sensor_owner=NULL, $page=-1, $per_page=-1)
 listGroupSensorTags ($group_id, $details=NULL, $namespace=NULL, $sensor_owner=NULL, $page=-1, $per_page=-1)
 listSensorTags ($sensor_id, $namespace=NULL)
 replaceSensorTags ($sensor_id, $metatags, $namespace=NULL)
 updateSensorTags ($sensor_id, $metatags, $namespace=NULL)
 deleteSensorTags ($sensor_id, $namespace=NULL)
 findSensorsByTags ($filter, $details=NULL, $namespace=NULL, $sensor_owner=NULL, $page=-1, $per_page=-1)
 findSensorsByTagsInGroup ($group_id, $filter, $details=NULL, $namespace=NULL, $sensor_owner=NULL, $page=-1, $per_page=-1)
 findDistinctMetatagValues ($metatag_name, $namespace=NULL)
 findDistinctMetatagValuesByFilter ($metatag_name, $filter, $namespace=NULL)

Detailed Description

sense dashboard - class.Api.php

$Id$

This file is part of sense dashboard.

Author:
Remi Appels <remi@sense-os.nl> The class Api handels all calls with the commonSense API

public

Author:
Remi Appels <remi@sense-os.nl>

Member Function Documentation

Api::addEnvironment ( name,
floors,
gps_outlines,
position 
)

This method creates a new environment. The gps_outline field should contain a list of latitude longitude points describing the outline of the environment.The list of points should create a polygon. The latitude longitude coordinates are separated by a space and each tuple by a comma. Optionally a third coordinate altitude can be specified after the longitude separated by a space. The gps_outline field can have 8000 characters. The position field should be the center of the environment which is also a gps point in the order latitude longitude altitude separated by spaces. The field floors indicates the amount of floors the environment has.

public

Parameters:
stringname
intfloors
stringgps_outlines
stringposition
Returns:
mixed
Api::addSensors ( group_id,
sensor_ids 
)

The method adds sensors to a group.

public

Parameters:
intgroup_id
ArraysensorIds
Returns:
mixed
Api::addSensorsToEnvironment ( id,
sensorIds 
)

The method adds a sensor to an environment. To connect an individual sensor a sensor object with only the sensor id can be given and to connect a list of sensors a sensors object with an array of sensor ids can be given.

public

Parameters:
intid
ArraysensorIds
Returns:
mixed
Api::addSensorTrigger ( sensor_id,
trigger_id 
)

This method will add a trigger to a sensor

public

Parameters:
intsensor_id
inttrigger_id
Returns:
json object
Api::addSensorTriggerNotification ( sensor_id,
trigger_id,
notification_id 
)

This method will add a notification to a sensor trigger

public

Parameters:
intsensor_id
inttrigger_id
intnotification_id
Returns:
json object
Api::addSharredUser ( sensorID,
userID,
username 
)

This method will add a user to a sensor, giving the user access to the sensor and data. Only the owner of the sensor is able to upload data, mutate sensors and add users to their sensor. To add a user at least a username or user_id must be specified.

public

Parameters:
intsensorID
intuserID
stringusername
Returns:
mixed
Api::addToParentDevice ( sensorID,
deviceID,
type,
uuid 
)

This method adds a sensor to a device. If the device does not exists then it will be created. Either a device_id or type and uuid combination is needed. The type of the sensor will then be automatically be set to 1.

public

Parameters:
intsensorID
intdeviceID
stringtype
stringuuid
Returns:
mixed
Api::addUserToGroup ( id,
userID,
userName 
)

This method will add a user to the group. To add a user at least a username or user_id must be specified. Only members of the group can add a user to the group.

public

Parameters:
intid
intuserID
stringuserName
Returns:
mixed
Api::api ( server = "")
Api::connectSensor ( sensorID,
connectedSensorID 
)

This method connects a sensor to the sensor selected with <sensor_id>. The type of the selected sensor will be automatically set to 2 (virtual sensor).

public

Parameters:
intsensorID
intconnectedSensorID
Returns:
mixed
Api::createGroup ( email,
name,
username,
password 
)

This method will create a group to which the current user will be added. A group can optionally have a username and password which can be used for login. The password must be in md5 format.

public

Parameters:
stringemail
stringname
stringusername
stringpassword
Returns:
JsonObject

This method will create a group to which the current user will be added. This method accepts the parameters for the group in the data array

public

Parameters:
arraydata
Returns:
JsonObject
Api::createNotification ( type,
text,
destination 
)

This method will create a new notification.

public

Parameters:
stringtype
stringtext
stringdestination
Returns:
json object
Api::createSensor ( name,
displayName,
deviceType,
pagerType,
dataType,
dataStructure 
)

This method will create a new sensor. A sensor can optionally have a pager_type which can be 'email' or 'sms'. Based on the pager_type a message with the current sensor value will be send. The data_type of a sensor can either be a value type (e.g. float, string) or json. With a json data_type a data_structure that specifies the structure of the json object is expected.

public

Parameters:
stringname
stringdisplayName
stringdeviceType
stringpagerType
stringdataType
stringdataStructure
Returns:
json object
Api::createTrigger ( name,
expression,
inactivity = NULL 
)

This method will create a new trigger.

public

Parameters:
stringname
stringexpression
intinactivity
Returns:
json object
Api::createUser ( email,
username,
name,
surname,
mobile,
password 
)

This method will create a user in the database. The username must be unique and the password must be a md5 hashed password. The response content will be contain the created user information. The uuid is a uniquely generated id which can be used to retrieve data without logging in.

public

Parameters:
stringemail
stringusername
stringname
stringsurname
stringmobile
stringpassword
Returns:
mixed

This method deletes all the uploaded files of the user.

public

Returns:
json object

This method deletes an environment.

public

Parameters:
intid
Returns:
mixed
Api::deleteFile ( sensorID,
dataID 
)

This method deletes the file that is uploaded and stored under the name given in this sensor data value.

public

Parameters:
intsensorID
intdataID
Returns:
json object
Api::deleteGroup ( id)

This method deletes the group if the group has no other members. If the group has other members then the current user will be removed from the group.

public

Parameters:
intid
Returns:
mixed
Api::deleterUser ( userID)

This method will remove the user from the database together with his external services.

public

Parameters:
intuserID
Returns:
mixed
Api::deleteSensor ( id)

This method will delete a sensor. If the current user is the owner of the sensor then the sensor will be removed from the current user and all other users. If the current user is not owner of the sensor then access to the sensor will be removed for this user.

public

Parameters:
intid
Returns:
mixed
Api::deleteSensorData ( sensorID,
dataID 
)

This method deletes a data point

public

Parameters:
intsensorID
intdataID
Returns:
mixed
Api::deleteSensorTags ( sensor_id,
namespace = NULL 
)

Delete sensor tags

This method will delete all the metatags for the given sensor in the given namespace

public

Parameters:
intsensor_id The sensor identifier
arraymetatags an array with the metatags
stringnamespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace.
Api::disconnectFromService ( sensorID,
serviceID 
)

This method disconnects the parent sensor from the service. The service will be stopped if it's not used by other sensors.

public

Parameters:
intsensorID
intserviceID
Returns:
mixed
Api::findDistinctMetatagValues ( metatag_name,
namespace = NULL 
)

Find distinct metatag values by metatag name

Via this method a list of distinct metatag values can be retrieved that have the given metatag name.

public

Parameters:
stringmetatag_name The name of the metatag
stringnamespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace.
Returns:
array The metatag values
Api::findDistinctMetatagValuesByFilter ( metatag_name,
filter,
namespace = NULL 
)

NOT yet implemented

Find distinct metatag values by metatag name and filter

Via this method a list of distinct metatag values can be retrieved that have the given metatag name.

public

Parameters:
stringmetatag_name The name of the metatag
arrayfilter {"filter":{"metatag_statement_groups":[[{"metatag_name":"greenhouse_number","operator":"equal","value":"1"},{"metatag_name":"greenhouse_number","operator":"equal","value":"2"}],[{"metatag_name":"color","operator":"equal","value":"green"}]],"sensor_statement_groups":[[{"sensor_property":"id","operator":"in","value":"1,2,3,4,5,6,7,8,9,10"}]]}} The filter array
stringnamespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace.
Returns:
array The metatag values
Api::findSensorsByTags ( filter,
details = NULL,
namespace = NULL,
sensor_owner = NULL,
page = -1,
per_page = -1 
)

Finding sensors by metatags

Via this method a list of sensors can be selected based on a set of conditions. Supported operators are “equal”, “in”, and “is_set”. All string comparisons are case INsensitive. Currently supported are two types of statement groups. The first is "metatag_statement_groups" which allows to find sensors based on their metatags. The second is "sensor_statement_groups" which allows to find sensors based on their own properties. Supported properties are id, name, type, device_type, data_type_id, pager_type, display_name and use_data_storage.

public

Parameters:
intgroup_id The group identifier
arrayfilter {"filter":{"metatag_statement_groups":[[{"metatag_name":"greenhouse_number","operator":"equal","value":"1"},{"metatag_name":"greenhouse_number","operator":"equal","value":"2"}],[{"metatag_name":"color","operator":"equal","value":"green"}]],"sensor_statement_groups":[[{"sensor_property":"id","operator":"in","value":"1,2,3,4,5,6,7,8,9,10"}]]}} The filter array
stringdetails (optional) To get all the related data as name, display_name, type, device_type, data_typ_id, pager_type, data_type and data_structure the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used.
stringnamespace (optional) Find metatags within the given namespace. If not given “default” is assumed as the namepace.
stringsensor_owner (optional) “me” only return metatags of sensors owned by the current user. “shared” only return sensors shared with me. "all” return all sensors owned by me or shared with me. When not given “me” is assumed
intpage (optional) This parameter specifies which page of the results must be retrieved. The page offset starts at 0.
intper_page (optional) This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items
Api::findSensorsByTagsInGroup ( group_id,
filter,
details = NULL,
namespace = NULL,
sensor_owner = NULL,
page = -1,
per_page = -1 
)

Finding sensors by metatags

Via this method a list of sensors can be selected based on a set of conditions. Supported operators are “equal”, “in”, and “is_set”. All string comparisons are case INsensitive. Currently supported are two types of statement groups. The first is "metatag_statement_groups" which allows to find sensors based on their metatags. The second is "sensor_statement_groups" which allows to find sensors based on their own properties. Supported properties are id, name, type, device_type, data_type_id, pager_type, display_name and use_data_storage.

public

Parameters:
intgroup_id The group identifier
arrayfilter {"filter":{"metatag_statement_groups":[[{"metatag_name":"greenhouse_number","operator":"equal","value":"1"},{"metatag_name":"greenhouse_number","operator":"equal","value":"2"}],[{"metatag_name":"color","operator":"equal","value":"green"}]],"sensor_statement_groups":[[{"sensor_property":"id","operator":"in","value":"1,2,3,4,5,6,7,8,9,10"}]]}} The filter array
stringdetails (optional) To get all the related data as name, display_name, type, device_type, data_typ_id, pager_type, data_type and data_structure the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used.
stringnamespace (optional) Find metatags within the given namespace. If not given “default” is assumed as the namepace.
stringsensor_owner (optional) “me” only return metatags of sensors owned by the current user. “shared” only return sensors shared with me. "all” return all sensors owned by me or shared with me. When not given “me” is assumed
intpage (optional) This parameter specifies which page of the results must be retrieved. The page offset starts at 0.
intper_page (optional) This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items

get error log

private

Returns:
string
Api::getFileLocation ( sensorID,
dataID 
)

The response header will contain a location header with the location of the file.

public

Parameters:
intsensorID
intdataID
Returns:
json object

Returns the session id if exists

public

Returns:
mixed
Api::learnPattern ( SensorID,
serviceID,
startData,
endDate,
label 
)

With this method states can be learned using previously stored data. This method is currently only available for the state_recognition_service and the pose_prediction_service. By giving a class label, start and end date, a state will be learned using the data from all the associated sensors from within the given time range.

public

Parameters:
intSensorID
intserviceID
DatestartData
DateendDate
stringlabel
Returns:
mixed

This method lists all the available services for all the sensors. Available services are selected based on their data fields.

public

Returns:
Array
Api::listAllUsers ( page,
perPage 
)

This method lists all the users in the database with only their user_id, name and surname.

public

Parameters:
intpage
intperPage
Returns:
mixed
Api::listAvailableServices ( sensorID)

This method lists all the available services for a sensor based on its data fields.

public

Parameters:
intsensorID
Returns:
mixed
Api::listConnectedSensors ( sensorID)

This method returns a list of sensors that the sensor with uses.

public

Parameters:
intsensorID
Returns:
Array

All the users devices that have sensors will be returned as json object

public

Returns:
Array of Divice objects

This method returns a list of environments of the current user.

public

Returns:
Array

This method list the sensors which are connected to this environment.

public

Parameters:
intid
Returns:
mixed

A list of groups will be returned where the current user is a member of.

public

Returns:
Group Array
Api::listGroupSensorTags ( group_id,
details = NULL,
namespace = NULL,
sensor_owner = NULL,
page = -1,
per_page = -1 
)

List sensor tags within a group

This method will return a list of sensors with their metatags in the given group.

public

Parameters:
stringdetails To get all the related data as name, display_name, type, device_type, data_typ_id, pager_type, data_type and data_structure the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used.
stringnamespace Find metatags within the given namespace. If not given “default” is assumed as the namepace.
stringsensor_owner “me” only return metatags of sensors owned by the current user. “shared” only return sensors shared with me. "all” return all sensors owned by me or shared with me. When not given “me” is assumed
intpage This parameter specifies which page of the results must be retrieved. The page offset starts at 0.
intper_page This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items
Api::listMetaTags ( details = NULL,
namespace = NULL,
sensor_owner = NULL,
page = -1,
per_page = -1 
)

This method will return a list of sensors with their metatags.

public

Parameters:
stringdetails To get all the related data as name, display_name, type, device_type, data_typ_id, pager_type, data_type and data_structure the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used.
stringnamespace Find metatags within the given namespace. If not given “default” is assumed as the namepace.
stringsensor_owner “me” only return metatags of sensors owned by the current user. “shared” only return sensors shared with me. "all” return all sensors owned by me or shared with me. When not given “me” is assumed
intpage This parameter specifies which page of the results must be retrieved. The page offset starts at 0.
intper_page This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items and the default amount is 100 items.
Returns:
mixed A sensor array with an array of metatags which consists of a key and an array of strings and/or integers

This method returns a list of notifications to which the current user has access.

public

Returns:
mixed
Api::listRunningServices ( sensorID)

This method lists all the running services for a sensor. It also lists the data fields of the sensor that are used by each service.

public

Parameters:
intsensorID
Returns:
mixed
Api::listSensorData ( id,
page = -1,
perPage = -1,
startDate = 0,
endDate = 0,
date = 0,
next = 0,
last = 0,
sort = 'DESC',
total = NULL,
interval = 0 
)

This method will return a list of sensor data. The maximum amount of data points that can be retrieved at once are 1000 items.

public

Parameters:
intid
intpage
intperPage
DatestartDate
DateendDate
Datedate
intnext
Booleanlast
stringsort
Booleantotal
Returns:
json object (max 1000 items)
Api::listSensors ( page,
perPage,
shared,
owned,
physical,
group_id = -1 
)

This method returns a list of sensors to which the current user has access.

public

Parameters:
intpage
intperPage
Booleanshared
Booleanowned
Booleanphysical
Booleandetails
Returns:
mixed
Api::listSensorTags ( sensor_id,
namespace = NULL 
)

List sensor tags

This method will return a list of metatags attached to the given sensor.

public *

Parameters:
intsensor_id The sensor identifier
stringnamespace Find metatags attached to given namespace. If not given “default” is assumed as the namespace.
Returns:
mixed An array of metatags which consists of a key and an array of strings and/or integers
Api::listSensorTriggers ( sensor_id)

This method returns a list of triggers which are connected to this sensor.

public

Returns:
mixed
Api::listServiceMethods ( sensorID,
serviceID 
)

This method lists all the available methods of the service selected with . These methods can be accessed to set and retrieve the settings of a service.

public

Parameters:
intsensorID
intserviceID
Returns:
mixed

This method returns a list of triggers to which the current user has access.

public

Returns:
mixed

This methods returns the members of the group as a list of users. Only group members can perform this action.

public

Parameters:
intid
Returns:
User Array
Api::login ( username,
password,
md5_used = false 
)

With this method a user can login with his username and md5 password hash. The function sets the needed session_id. This session_id is used for authentication. A user can be logged in on multiple locations.

public

Parameters:
stringusername
stringpassword
Returns:
mixed

This method will logout the user by destroying its session.

public

Returns:
mixed
Api::oauthLogin ( key,
secret 
)

With this method a user can login using oAuth. The function sets the needed session_id. This session_id is used for authentication at the oAuth authentication page.

public

Parameters:
stringoauth key
stringoauth secret
Returns:
mixed

This method returns the details of the current user.

public

Returns:
User
Api::readDevice ( id)

Returns the details of a device that has sensors

public

Parameters:
intid
Returns:
Divice object
Api::readDeviceSensors ( id,
page,
perPage,
details 
)

Returns the sensors that are physically connected to the device

public

Parameters:
intid
intpage
intperPage
booleandetails
Returns:
array of Sensor objects

The method returns the details of the selected environment

public

Parameters:
intid
Returns:
Environment
Api::readGroup ( id)

This method returns the details of a group. Only members of a group can see the details of a group.

public

Parameters:
intid
Returns:
json object
Api::readParentDevice ( sensorID)

This method returns the details of the device to witch the sensor is connected.

public

Parameters:
intsensorID
Returns:
mixed
Api::readSensor ( id)

This method will return the details of a sensor.

public

Parameters:
intid
Returns:
Sensor

The method returns the details of the environment of this sensor.

public

Parameters:
intid
Returns:
mixed
Api::readUser ( int $  userID)

This method returns the details of the selected user. Only the current user can be selected. This method gives the same output as /users/current

public

Parameters:
intuserID
Returns:
mixed
Api::removeConnectedSensor ( sensorID,
connectedSensor 
)

This method removes a sensor from the parent sensor. If the parent sensor does not have any sensors that it uses, its type will automatically be set to 0. If this parent sensor is also a service, then the connected sensor will also be disconnected from the service.

public

Parameters:
intsensorID
intconnectedSensor
Returns:
mixed
Api::removeFromParentDevice ( sensorID)

This method will remove a sensor from a device. The type of the device will then automatically be set to 0.

public

Parameters:
intsensorID
Returns:
mixed
Api::removeSensorFromEnvironment ( environmentID,
sensorID 
)

This method removes the selected sensor from the selected environment.

public

Parameters:
intenvironmentID
intsensorID
Returns:
mixed
Api::removeSharredUser ( sensorID,
userID 
)

This method removes a users from a sensor, which removes the access to the sensor for this user.

public

Parameters:
intsensorID
intuserID
Returns:
mixed
Api::replaceSensorTags ( sensor_id,
metatags,
namespace = NULL 
)

Replacing sensor tags

This method will persist a list of metatags to the given sensor. All metatags that are not mentioned in the uploaded list are removed from the sensor. Metatag names can have a maximum length of 32 (ASCII) characters. The metatag value can have a maximum length of 100 (UTF-8) characters. For now we impose a limit on the amount of metatags attached to a sensor in a single namespace. Currently this is set on 30.

public

Parameters:
intsensor_id The sensor identifier
arraymetatags an array with the metatags
stringnamespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace.
Api::runServiceGetMethod ( sensorID,
serviceID,
method 
)

To retrieve information about a service, one of its 'get_methods' can be accessed by specifying the method name in the request url.

public

Parameters:
intsensorID
intserviceID
stringmethod
Returns:
mixed
Api::runServiceSetMethod ( sensorID,
serviceID,
method,
parameters 
)

To change specific settings of a service, one of its 'set_methods' can be accessed by specifying the method name in the request url. The parameters for the method are send in a parameters array. The response content is based on the method return type. If the method does not have a return value then it will return an object with result ok if the method succeeds.

public

Parameters:
intsensorID
intserviceID
stringmethod
Arrayparameters
Returns:
mixed
Api::setSessionId ( sessionid)
Api::sharredUsers ( sensorID)

This method will list the users that have access to the sensor.

public

Parameters:
intsensorID
Returns:
Array
Api::updateEnvironment ( id,
name 
)

This method updates an environment. Only the fields that are send will be updated.

public

Parameters:
intid
stringname
Returns:
mixed
Api::updateGroup ( id,
email,
username,
password,
name 
)

This method will update the details of a group. Only the values specified as input will be updates. Every member of the group can update the group details

public

Parameters:
intid
stringemail
stringusername
stringpassword
stringname
Returns:
json object
Api::updateSensorDescription ( id,
name,
displayName,
deviceType,
pagerType,
dataType,
dataStructure 
)

This method will update an existing sensor.

public

Parameters:
intid
stringname
stringdisplayName
stringdeviceType
stringpagerType
stringdataType
stringdataStructure
Returns:
mixed
Api::updateSensorSpecificData ( id,
value,
date 
)

With this method sensor data can be uploaded. The uploaded data can either be a single value or an array.

public

Parameters:
intid
stringvalue
Datedate
Returns:
mixed
Api::updateSensorTags ( sensor_id,
metatags,
namespace = NULL 
)

Modifying sensor tags

This method will persist a list of metatags. Existing metatags not mentioned in the uploaded list will be kept. Metatag names can have a maximum length of 32 (ASCII) characters. The metatag value can have a maximum length of 100 (UTF-8) characters. For now we impose a limit on the amount of metatags attached to a sensor in a single namespace. Currently this is set on 30. For now we impose a limit on the amount of metatags attached to a sensor in a single namespace. Currently this is set on 30.

public

Parameters:
intsensor_id The sensor identifier
arraymetatags an array with the metatags
stringnamespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace.
Api::updateSensorTrigger ( sensor_id,
trigger_id,
active = 0,
last_sensor_data_value = "",
last_sensor_data_date = 0 
)

This method will update a sensor trigger

public

Parameters:
intsensor_id
inttrigger_id
Returns:
json object
Api::updateUser ( userID,
email,
username,
name,
surname,
mobile,
password 
)

This method updates the details of the user. Only the user_id of the current user can be selected.

public

Parameters:
intuserID
stringemail
stringusername
stringname
stringsurname
stringmobile
stringpassword
Returns:
mixed
Api::uploadSensorData ( json)

With this method sensor data can be uploaded at once for different sensors. The uploaded data can either be a single value or an array.

public

Parameters:
stringjson
Returns:
json object
Api::useService ( sensorID,
json 
)

This method connects a sensor to a service. In the POST data a service object is posted with the name of the service that is used. If the id of an existing service object is specified then this sensor will be connected to that service. Otherwise a new service will be created. In the optional array 'data_fields' the data fields of the sensor that should be used by this service can be specified. For every new service a virtual sensor is created. Data send from this service is stored under that virtual sensor. Optionally a sensor object with the name and device_type for the virtual sensor can be posted along with the creation of the service.

public

Parameters:
IntergersensorID
stringjson
Returns:
mixed

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables