Sensors

List sensors: GET /sensors

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

URLhttps://api.sense-os.nl/sensors
MethodGET
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType
pageThis parameter specifies which page of the results must be retrieved. The page offset starts at 0. xsd:integer
per_pageThis parameter specifies the amount of items that must be received at once. The maximum amount is 1000 items and the default amount is 100 items. xsd:integer
sharedWith this parameter set to 1, only sensors which the user shares with others are displayed. The sensor object will contain an array named users with the ids of users that have access to the sensor. xsd:boolean
ownedWith this parameter set to 1, only sensors which the user owns are displayed. When it's set to 0 only sensors which the user does not own are displayed. The sensor object will contain an user object named owner with the id, name, surname, email and username of the owner of the sensor. xsd:boolean
physicalWith this parameter set to 1, only physical sensors will be returned. Also information of the sensor's parent device will be given in the fields device_device_type and device_device_uuid unless the parameter owned is used. xsd:boolean
detailsTo get all the related data as device, environment and owner the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used. xsd:string
group_idThis parameter should be set to a group id to list only the sensors of that group. xsd:boolean

Delete sensor and its data: DELETE /sensors/{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.

URLhttps://api.sense-os.nl/sensors/{id}
MethodDELETE
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Create sensor: POST /sensors

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.

URLhttps://api.sense-os.nl/sensors
MethodPOST
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Request Body

{
    "sensor": {
        "name": "accelerometer",
        "display_name": "Accelerometer",
        "device_type": "BMA123",
        "pager_type": "email",
        "data_type": "json",
        "data_structure": "{\"x-axis\":\"float\",\"y-axis\":\"float\",\"z-axis\":\"float\"}"
    }
}

Update sensor description: PUT /sensors/{id}

This method will update an existing sensor.

URLhttps://api.sense-os.nl/sensors/{id}
MethodPUT
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Request Body

{
    "sensor": {
        "name": "accelerometer",
        "display_name": "Accelerometer",
        "device_type": "BMA333",
        "pager_type": "email",
        "data_type": "json",
        "data_structure": "{\"x-axis\":\"float\",\"y-axis\":\"float\",\"z-axis\":\"float\"}"
    }
}