Environments

List environments: GET /environments

This method lists the environments of a user

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Delete environment: DELETE /environments/{id}

This method deletes an environemnt

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

List sub environments: GET /environments/{id}/environments

This method returns the sub environments of a selected environment.

URLhttps://api.sense-os.nl/environments/{id}/environments
MethodGET
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Create environment: POST /environments

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.

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Request Body

The environment object

{
    "environment": {
        "name": "Sense",
        "floors": "3",
        "gps_outline": "51.903714 4.459679,51.903415 4.4598,51.903421 4.459896,51.903732 4.459805,51.903714 4.459679",
        "position": "51.903492 4.460028"
    }
}

Remove sub environment: DELETE /environments/{id}/environments/{sub_id}

This method removes a sub environment from an environment

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Update environment: PUT /environments/{id}

This method updates an environment

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Request Body

The environment object

{
    "environment": {
        "name": "Sense",
        "floors": "3",
        "gps_outline": "51.903714 4.459679,51.903415 4.4598,51.903421 4.459896,51.903732 4.459805,51.903714 4.459679",
        "position": "51.903492 4.460028"
    }
}

Add sensors to environment: POST /environments/{id}/sensors

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.

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Request Body

The sensor array

{
    "sensors": [
        {
            "id": 20
        },
        {
            "id": 21
        }
    ]
}

List environment sensors: GET /environments/{id}/sensors

This method lists the sensors which are connected to this environment

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Add sub environment: POST /environments/{id}/environments

This method adds sub environments to an environment

URLhttps://api.sense-os.nl/environments/{id}/environments
MethodPOST
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Request Body

The environment array

{
    "environments": [
        {
            "id": 10
        }
    ]
}

Remove sensor from environment: DELETE /environments/{environment_id}/sensors/{sensor_id}

This method removes the selected sensor from the environment

URLhttps://api.sense-os.nl/environments/{environmentid}/sensors/{sensorid}
MethodDELETE
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Read environment: GET /sensors/{id}/environment

The method returns the details of the selected environment

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

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType