API Type: airSensor (20191112)

Download OpenAPI specification:Download

Introduction

It is specific API of BleBox devices with API type: airSensor

Please check API type and API level (version) before use,
if you don't see the expected field in response from a real device then hardware version do not support this feature.

General

Information about device

Returns general information about device

Responses

200

OK

get/api/device/state

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/device/state

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/device/state

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/device/state

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "device":
    {
    }
}

Device upTime

Returns information about number of seconds from boot

Responses

200

OK

get/api/device/uptime

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/device/uptime

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/device/uptime

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/device/uptime

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "upTimeS": 243269
}

Perform firmware update

Perform firmware update. Return conflict if update is in progress

Responses

200

OK

409

Conflict

post/api/ota/update

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/ota/update

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/ota/update

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/ota/update

Network

Network information

Returns information about internal WiFi AP or about connected local WiFi network

Responses

200

OK

get/api/device/network

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/device/network

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/device/network

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/device/network

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ssid": "WiFi_Name",
  • "bssid": "70:4f:25:24:11:ae",
  • "ip": "192.168.1.11",
  • "mac": "bb:50:ec:2d:22:17",
  • "station_status": 5,
  • "tunnel_status": 5,
  • "apEnable": true,
  • "apSSID": "shutterBox-g650e32d2217",
  • "apPasswd": "my_secret_password",
  • "channel": 7
}

Local WiFi Status Deprecated

Returns information about connected local WiFi network and if scanning is in progress

It is deprecated -> look at:

Responses

200

OK

get/api/wifi/status

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/wifi/status

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/wifi/status

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/wifi/status

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "scanning": false,
  • "ssid": "WiFi_Name",
  • "ip": "192.168.1.11",
  • "station_status": 5
}

Set internal access Point's settings

Allows to set interal access Point's ssid and password. Allows also to turn off internal AP.

Request Body schema: application/json
network
required
object

Internal access Point's settings

Responses

200

OK

400

Bad request

post/api/device/set

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/device/set

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/device/set

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/device/set

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "network":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "device":
    {
    },
  • "network":
    {
    }
}

Perform WiFi scan and get results

Perform WiFi scan and return list of found WiFi networks. Return conflict if scanning is in progress

Responses

200

OK

409

Conflict

get/api/wifi/scan

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/wifi/scan

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/wifi/scan

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/wifi/scan

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ap":
    [
    ]
}

Perform WiFi connect

Perform connect to local WiFi network

Request Body schema: application/json
ssid
required
string [ 0 .. 32 ] characters

SSID of WiFi network.
Empty string will disconnect from WiFi network

pwd
string [ 0 .. 64 ] characters Nullable

Password to WiFi network. Empty string or 'null' indicates open mode (without password).

Responses

200

OK

400

Bad request

post/api/wifi/connect

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/wifi/connect

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/wifi/connect

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/wifi/connect

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ssid": "WiFi_Name",
  • "pwd": "my_secret_password"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ssid": "WiFi_Name",
  • "station_status": 5
}

Perform WiFi disconnect

Perform disconnect from current local WiFi network

Responses

200

OK

post/api/wifi/disconnect

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/wifi/disconnect

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/wifi/disconnect

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/wifi/disconnect

State

airSensor state

Returns information about sensors (measurements)

Responses

200

OK

get/api/air/state

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/air/state

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/air/state

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/air/state

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "air":
    {
    }
}

Extended airSensor state

Returns extended information about sensors (measurements)
- (Endpoint returns the same as /api/air/state)
- (all parameters needed to display user interface)

Responses

200

OK

get/api/air/extended/state

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/air/extended/state

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/air/extended/state

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/air/extended/state

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "air":
    {
    }
}

Sensor runtime

Returns information about run time of internal air quality sensor

Responses

200

OK

get/api/air/runtime

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/air/runtime

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/air/runtime

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/air/runtime

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "runtime":
    {
    }
}

Control with GET

Force measurement

Allows to force measurement immediately

Responses

200

OK

get/s/kick

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/s/kick

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/s/kick

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/s/kick

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "air":
    {
    }
}

Settings

Settings state

Return device's specific settings

Responses

200

OK

get/api/settings/state

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/settings/state

Controller's web server - connecting via local network - please change IP

http://IP_in_local_network/api/settings/state

Controller's web server - connecting via local network - for own DNS resolving

http://device.blebox/api/settings/state

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "settings":
    {
    }
}

Settings set

Allow to set device's specific settings

Request Body schema: application/json
settings
object

Responses

200

OK

400

Bad request

post/api/settings/set

Controller's web server - connecting via device's WiFi AP

http://192.168.4.1/api/settings/set

Controller's web server - connecting via local network - please ch