API Type: switchBoxD (20200229)

Download OpenAPI specification:Download

Introduction

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

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/info

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

http://192.168.4.1/info

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

http://IP_in_local_network/info

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

http://device.blebox/info

Response samples

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

Information about device Deprecated

Returns general information about device

It is deprecated -> look at:

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

Response samples

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

Control & State

Device state

Returns information about relays state

Responses

200

OK

get/state

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

http://192.168.4.1/state

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

http://IP_in_local_network/state

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

http://device.blebox/state

Response samples

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

State set

Allow to set desired relay state (ON, OFF, TOGGLE, FORTIME)

Request Body schema: application/json
relays
Array of objects [ 1 .. 2 ] items

List of relays state

Responses

200

OK

400

Bad request

post/state

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

http://192.168.4.1/state

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

http://IP_in_local_network/state

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

http://device.blebox/state

Request samples

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

Response samples

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

Relay state Deprecated

Returns information about relays state

It is deprecated -> look at:

Responses

200

OK

get/api/relay/state

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

http://192.168.4.1/api/relay/state

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

http://IP_in_local_network/api/relay/state

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

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

Response samples

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

Extended device state

Returns extended information about device and relays
(all parameters needed to display user interface)

Responses

200

OK

get/state/extended

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

http://192.168.4.1/state/extended

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

http://IP_in_local_network/state/extended

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

http://device.blebox/state/extended

Response samples

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

Extended relay state Deprecated

extended information about device and relays
(all parameters needed to display user interface)


It is deprecated -> look at:

Responses

200

OK

get/api/relay/extended/state

Controll