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) |
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
string | name |
int | floors |
string | gps_outlines |
string | position |
Api::addSensors | ( | $ | group_id, |
$ | sensor_ids | ||
) |
The method adds sensors to a group.
public
int | group_id |
Array | sensorIds |
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
int | id |
Array | sensorIds |
Api::addSensorTrigger | ( | $ | sensor_id, |
$ | trigger_id | ||
) |
This method will add a trigger to a sensor
public
int | sensor_id |
int | trigger_id |
Api::addSensorTriggerNotification | ( | $ | sensor_id, |
$ | trigger_id, | ||
$ | notification_id | ||
) |
This method will add a notification to a sensor trigger
public
int | sensor_id |
int | trigger_id |
int | notification_id |
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
int | sensorID |
int | userID |
string | username |
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
int | sensorID |
int | deviceID |
string | type |
string | uuid |
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
int | id |
int | userID |
string | userName |
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
int | sensorID |
int | connectedSensorID |
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
string | |
string | name |
string | username |
string | password |
Api::createGroupFromArray | ( | $ | data | ) |
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
array | data |
Api::createNotification | ( | $ | type, |
$ | text, | ||
$ | destination | ||
) |
This method will create a new notification.
public
string | type |
string | text |
string | destination |
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
string | name |
string | displayName |
string | deviceType |
string | pagerType |
string | dataType |
string | dataStructure |
Api::createTrigger | ( | $ | name, |
$ | expression, | ||
$ | inactivity = NULL |
||
) |
This method will create a new trigger.
public
string | name |
string | expression |
int | inactivity |
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
string | |
string | username |
string | name |
string | surname |
string | mobile |
string | password |
This method deletes all the uploaded files of the user.
public
Api::deleteEnvironment | ( | $ | id | ) |
This method deletes an environment.
public
int | id |
Api::deleteFile | ( | $ | sensorID, |
$ | dataID | ||
) |
This method deletes the file that is uploaded and stored under the name given in this sensor data value.
public
int | sensorID |
int | dataID |
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
int | id |
Api::deleterUser | ( | $ | userID | ) |
This method will remove the user from the database together with his external services.
public
int | userID |
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
int | id |
Api::deleteSensorData | ( | $ | sensorID, |
$ | dataID | ||
) |
This method deletes a data point
public
int | sensorID |
int | dataID |
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
int | sensor_id The sensor identifier |
array | metatags an array with the metatags |
string | namespace (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
int | sensorID |
int | serviceID |
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
string | metatag_name The name of the metatag |
string | namespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace. |
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
string | metatag_name The name of the metatag |
array | filter {"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 |
string | namespace (optional) Attach metatags to the given namespace. If not given “default” is assumed as the namespace. |
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
int | group_id The group identifier |
array | filter {"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 |
string | details (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. |
string | namespace (optional) Find metatags within the given namespace. If not given “default” is assumed as the namepace. |
string | sensor_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 |
int | page (optional) This parameter specifies which page of the results must be retrieved. The page offset starts at 0. |
int | per_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
int | group_id The group identifier |
array | filter {"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 |
string | details (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. |
string | namespace (optional) Find metatags within the given namespace. If not given “default” is assumed as the namepace. |
string | sensor_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 |
int | page (optional) This parameter specifies which page of the results must be retrieved. The page offset starts at 0. |
int | per_page (optional) This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items |
Api::getErrorLog | ( | ) |
get error log
private
Api::getFileLocation | ( | $ | sensorID, |
$ | dataID | ||
) |
The response header will contain a location header with the location of the file.
public
int | sensorID |
int | dataID |
Returns the session id if exists
public
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
int | SensorID |
int | serviceID |
Date | startData |
Date | endDate |
string | label |
This method lists all the available services for all the sensors. Available services are selected based on their data fields.
public
Api::listAllUsers | ( | $ | page, |
$ | perPage | ||
) |
This method lists all the users in the database with only their user_id, name and surname.
public
int | page |
int | perPage |
Api::listAvailableServices | ( | $ | sensorID | ) |
This method lists all the available services for a sensor based on its data fields.
public
int | sensorID |
Api::listConnectedSensors | ( | $ | sensorID | ) |
This method returns a list of sensors that the sensor with uses.
public
int | sensorID |
Api::listDevices | ( | ) |
All the users devices that have sensors will be returned as json object
public
This method returns a list of environments of the current user.
public
Api::listEnvironmentSensors | ( | $ | id | ) |
This method list the sensors which are connected to this environment.
public
int | id |
Api::listGroups | ( | ) |
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
string | details 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. |
string | namespace Find metatags within the given namespace. If not given “default” is assumed as the namepace. |
string | sensor_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 |
int | page This parameter specifies which page of the results must be retrieved. The page offset starts at 0. |
int | per_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
string | details 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. |
string | namespace Find metatags within the given namespace. If not given “default” is assumed as the namepace. |
string | sensor_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 |
int | page This parameter specifies which page of the results must be retrieved. The page offset starts at 0. |
int | per_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. |
This method returns a list of notifications to which the current user has access.
public
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
int | sensorID |
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
int | id |
int | page |
int | perPage |
Date | startDate |
Date | endDate |
Date | date |
int | next |
Boolean | last |
string | sort |
Boolean | total |
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
int | page |
int | perPage |
Boolean | shared |
Boolean | owned |
Boolean | physical |
Boolean | details |
Api::listSensorTags | ( | $ | sensor_id, |
$ | namespace = NULL |
||
) |
List sensor tags
This method will return a list of metatags attached to the given sensor.
public *
int | sensor_id The sensor identifier |
string | namespace Find metatags attached to given namespace. If not given “default” is assumed as the namespace. |
Api::listSensorTriggers | ( | $ | sensor_id | ) |
This method returns a list of triggers which are connected to this sensor.
public
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
int | sensorID |
int | serviceID |
This method returns a list of triggers to which the current user has access.
public
Api::listUsersOfGroup | ( | $ | id | ) |
This methods returns the members of the group as a list of users. Only group members can perform this action.
public
int | id |
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
string | username |
string | password |
Api::logout | ( | ) |
This method will logout the user by destroying its session.
public
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
string | oauth key |
string | oauth secret |
Api::readDevice | ( | $ | id | ) |
Returns the details of a device that has sensors
public
int | id |
Api::readDeviceSensors | ( | $ | id, |
$ | page, | ||
$ | perPage, | ||
$ | details | ||
) |
Returns the sensors that are physically connected to the device
public
int | id |
int | page |
int | perPage |
boolean | details |
Api::readEnvironment | ( | $ | id | ) |
The method returns the details of the selected environment
public
int | id |
Api::readGroup | ( | $ | id | ) |
This method returns the details of a group. Only members of a group can see the details of a group.
public
int | id |
Api::readParentDevice | ( | $ | sensorID | ) |
This method returns the details of the device to witch the sensor is connected.
public
int | sensorID |
Api::readSensor | ( | $ | id | ) |
Api::readSensorEnvironment | ( | $ | id | ) |
The method returns the details of the environment of this sensor.
public
int | id |
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
int | userID |
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
int | sensorID |
int | connectedSensor |
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
int | sensorID |
Api::removeSensorFromEnvironment | ( | $ | environmentID, |
$ | sensorID | ||
) |
This method removes the selected sensor from the selected environment.
public
int | environmentID |
int | sensorID |
Api::removeSharredUser | ( | $ | sensorID, |
$ | userID | ||
) |
This method removes a users from a sensor, which removes the access to the sensor for this user.
public
int | sensorID |
int | userID |
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
int | sensor_id The sensor identifier |
array | metatags an array with the metatags |
string | namespace (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
int | sensorID |
int | serviceID |
string | method |
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
int | sensorID |
int | serviceID |
string | method |
Array | parameters |
Api::setSessionId | ( | $ | sessionid | ) |
Api::sharredUsers | ( | $ | sensorID | ) |
This method will list the users that have access to the sensor.
public
int | sensorID |
Api::updateEnvironment | ( | $ | id, |
$ | name | ||
) |
This method updates an environment. Only the fields that are send will be updated.
public
int | id |
string | name |
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
int | id |
string | |
string | username |
string | password |
string | name |
Api::updateSensorDescription | ( | $ | id, |
$ | name, | ||
$ | displayName, | ||
$ | deviceType, | ||
$ | pagerType, | ||
$ | dataType, | ||
$ | dataStructure | ||
) |
This method will update an existing sensor.
public
int | id |
string | name |
string | displayName |
string | deviceType |
string | pagerType |
string | dataType |
string | dataStructure |
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
int | id |
string | value |
Date | date |
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
int | sensor_id The sensor identifier |
array | metatags an array with the metatags |
string | namespace (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
int | sensor_id |
int | trigger_id |
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
int | userID |
string | |
string | username |
string | name |
string | surname |
string | mobile |
string | password |
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
string | json |
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
Interger | sensorID |
string | json |