Ruckus IoT Controller REST API Document

General notes

API documentation is a technical content deliverable, containing instructions about how to effectively use and integrate with an API. It’s a concise reference manual containing all the information required to work with the API, with details about the functions, classes, return types, arguments. This document provides interface to create, update, operate and manage Ruckus IoT Controller, Ruckus IoT Access Points and IoT Devices/Sensors. API communicates on secured mode (HTTPS/SSL) and needs valid credentials to authenticate to the system. APIs upon successful authentication, uses ACCESS and REFRESH token to communicate with the system.

Overview

The API follows the ReST API format and follows the protocol with respect to the API methods and the status codes returned after invoking the APIs.

API detail

Account Auth

Authenticate User

This endpoint is a basic-auth protected endpoint.

This endpoint authenticates the user. The user credentials needs to be provided as basic-auth in the http auth header.

The response on a successful request will be the details of the user.

Response Key Explanation

Key Explanation
company Name of the company of the user
email E-mail address of the user
send_notification User preference to receive notifications
is_enabled User is enabled
first_name Firstname of the User
password Encrypted password of the user
username Username of the user
last_name Lastname of the user

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid user credentials
500 Critical Server Error
curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" "{{auth_host}}/v1/oauth/authenticate"
GET %7B%7Bauth_host%7D%7D/v1/oauth/authenticate HTTP/1.1
Host: 
Authorization: Basic YWRtaW46YWRtaW4=
Status200
allowGET, HEAD, OPTIONS
connectionclose
content-length296
content-typeapplication/json
dateMon, 04 Sep 2017 05:39:00 GMT
servergunicorn/19.6.0
varyAccept
x-frame-optionsSAMEORIGIN
{
    "is_enabled": true,
    "send_notification": false,
    "first_name": "Ed",
    "company": "Ruckus",
    "username": "admin",
    "last_name": "Sy",
    "_id": {
        "$oid": "59a798b040a1286ca3e46524"
    },
    "password": "$pbkdf2-sha256$29000$0bq3tjaGUOpdi5HSWosR4g$1EmpXGaCewvT7q47bF/RzZA5y6WLNGQpmxbbnHFCgAE",
    "email": "[email protected]"
}
Status401
allowGET, HEAD, OPTIONS
connectionclose
content-length39
content-typeapplication/json
dateMon, 04 Sep 2017 05:39:26 GMT
servergunicorn/19.6.0
varyAccept
www-authenticateBasic realm="api"
x-frame-optionsSAMEORIGIN
{
    "detail": "Invalid username/password."
}

Get Token

This endpoint is a basic-auth protected endpoint.

The response on a successful request will be the details of tokens. These tokens will be used to regenerate tokens and access the APIs.

Response Key Explanation

Key Explanation
access_token Token for accessing endpoints protected by token authentication
refresh_token Token to refresh the access token once it is expired

The validity of access_token is 600 seconds. The refresh_token should be saved once the tokens are generated. The refresh_token should be used to generate the new access_token after their expiry.

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid user credentials
500 Critical Server Error
curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" "{{auth_host}}/v1/oauth/login"
GET %7B%7Bauth_host%7D%7D/v1/oauth/login HTTP/1.1
Host: 
Authorization: Basic YWRtaW46YWRtaW4=
Status200
allowGET, HEAD, OPTIONS
content-length115
content-typeapplication/json
dateMon, 04 Sep 2017 10:07:35 GMT
serverWSGIServer/0.2 CPython/3.5.2
varyAccept
x-frame-optionsSAMEORIGIN
{
    "refresh_token": "ba881b2d9e3c4906b4323d74b5993796",
    "access_token": "956a6e403f5c4e6fb8f6c7fe478a6b68"
}
Status401
allowGET, HEAD, OPTIONS
content-length39
content-typeapplication/json
dateMon, 04 Sep 2017 10:12:11 GMT
serverWSGIServer/0.2 CPython/3.5.2
varyAccept
www-authenticateBasic realm="api"
x-frame-optionsSAMEORIGIN
{
    "detail": "Invalid username/password."
}

Refresh Token

This endpoint is a token-auth protected endpoint.

This endpoint is used to generate a new access token. The validity of the access_token is 600 seconds. The refresh token retrieved during the Get Token should be passed in the header as token-auth. On successful refresh of the token a new access token will be provided.

Response Key Explanation

Key Explanation
access_token Token for accessing endpoints protected by token authentication

The new access_token should be saved and replaced with the previous access_token.

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
500 Critical Server Error
curl -X GET -H "Authorization: Token 36ee6c711164485b9b2494c2e3b0efde" "{{auth_host}}/v1/oauth/refresh"
GET %7B%7Bauth_host%7D%7D/v1/oauth/refresh HTTP/1.1
Host: 
Authorization: Token 36ee6c711164485b9b2494c2e3b0efde
Status200
allowGET, HEAD, OPTIONS
content-length58
content-typeapplication/json
dateMon, 04 Sep 2017 10:23:49 GMT
serverWSGIServer/0.2 CPython/3.5.2
varyAccept
x-frame-optionsSAMEORIGIN
{
    "access_token": "aa4c7236f4384aba832096538b127a9b"
}
Status401
allowGET, HEAD, OPTIONS
content-length27
content-typeapplication/json
dateMon, 04 Sep 2017 10:25:42 GMT
serverWSGIServer/0.2 CPython/3.5.2
varyAccept
www-authenticatetoken
x-frame-optionsSAMEORIGIN
{
    "detail": "Invalid Token."
}

Accounts CRUD

These are the set of APIs to create the account with RIoT controller. Currently these API are in the basic state which will evolve over time.

Status: Experimental

All Accounts

This endpoint is used to retrieve all the devices which are added in the controller.

curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" "{{auth_host}}/v1/account"
GET %7B%7Bauth_host%7D%7D/v1/account HTTP/1.1
Host: 
Authorization: Basic YWRtaW46YWRtaW4=
Status200
AllowGET, POST, HEAD, OPTIONS
Connectionkeep-alive
Content-Length197
Content-Typeapplication/json
DateWed, 21 Nov 2018 10:36:38 GMT
Servernginx
Strict-Transport-Securitymax-age=63072000
VaryAccept
X-Frame-OptionsSAMEORIGIN
X-Frame-OptionsSAMEORIGIN
[
    {
        "last_name": "Sy",
        "first_name": "Ed",
        "email": "[email protected]",
        "_id": {
            "$oid": "5be95439a856d004ec65e09b"
        },
        "is_enabled": true,
        "username": "admin",
        "company": "Ruckus",
        "send_notification": false
    }
]

Single Account

This endpoint is used to retrieve all the devices which are added in the controller.

curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" "{{auth_host}}/v1/account/username"
GET %7B%7Bauth_host%7D%7D/v1/account/username HTTP/1.1
Host: 
Authorization: Basic YWRtaW46YWRtaW4=
Status200
AllowGET, PATCH, DELETE, HEAD, OPTIONS
Connectionkeep-alive
Content-Length195
Content-Typeapplication/json
DateWed, 21 Nov 2018 10:37:37 GMT
Servernginx
Strict-Transport-Securitymax-age=63072000
VaryAccept
X-Frame-OptionsSAMEORIGIN
X-Frame-OptionsSAMEORIGIN
{
    "last_name": "Sy",
    "first_name": "Ed",
    "email": "[email protected]",
    "_id": {
        "$oid": "5be95439a856d004ec65e09b"
    },
    "is_enabled": true,
    "username": "admin",
    "company": "Ruckus",
    "send_notification": false
}

Create Account

This endpoint is used to retrieve all the devices which are added in the controller.

curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic YWRtaW46YWRtaW4=" -d '{
  "username": "admin1",
  "first_name": "John",
  "last_name": "Doe",
  "company": "RIoT Admin",
  "email": "[email protected]",
  "password": "admin1",
  "phone": "9876543210",
  "send_notification": false
}' "{{auth_host}}/v1/account"
POST %7B%7Bauth_host%7D%7D/v1/account HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4=

{
  "username": "admin1",
  "first_name": "John",
  "last_name": "Doe",
  "company": "RIoT Admin",
  "email": "[email protected]",
  "password": "admin1",
  "phone": "9876543210",
  "send_notification": false
}
Status200
AllowGET, POST, HEAD, OPTIONS
Connectionkeep-alive
Content-Length216
Content-Typeapplication/json
DateWed, 21 Nov 2018 10:39:05 GMT
Servernginx
Strict-Transport-Securitymax-age=63072000
VaryAccept
X-Frame-OptionsSAMEORIGIN
X-Frame-OptionsSAMEORIGIN
{
    "first_name": "John",
    "username": "admin1",
    "is_enabled": true,
    "_id": {
        "$oid": "5bf535c9e2082806210c339d"
    },
    "last_name": "Doe",
    "phone": "9876543210",
    "send_notification": false,
    "company": "RIoT Admin",
    "email": "[email protected]"
}

Authentication

All the APIs are protected with token-auth.To get a token for interacting with the APIs the token needs to be generated using basic-auth.

Basic Auth

The endpoints protected with a basic-auth accepts a username and password and returns a status code of 200 ok only if the same is provided. Otherwise it will return a status code 401 unauthorized.

Username: admin

Password: admin

To use this endpoint, send a request with the header Authorization: Basic YWRtaW46YWRtaW4=. The cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. Using Postman, to send this request, you can simply fill in the username and password in the “Authorization” tab and Postman will do the rest for you.

To know more about basic authentication, refer to the Basic Access Authentication wikipedia article. The article on authentication helpers elaborates how to use the same within the Postman app.

Token Auth

The endpoints protected with a token-auth accepts a token and returns a status code of 200 ok only if the same is provided. Otherwise it will return a status code 401 unauthorized.

To use this endpoint, send a request with the header Authorization: Token 086a5de496084e1a8a46ff0ed18a6b10. The token has to be retrieved from the Get Token API and then has to be provided in the header of the API requests. Using Postman, to send this request, you can simply fill in the username and password in the “Authorization” tab and Postman will do the rest for you.

To know more about token authentication, refer to the Token Access Authentication wikipedia article. The article on authentication helpers elaborates how to use the same within the Postman app.

COEX

Gateway COEX enable

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the IOT APPROVED of the IoT network in the AP. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/IOT_APPROVED

Once the API is called the iot_approved in the gateway is set and the IoT process will reboot. Once the API is called the gateway connected state as false. Once the gateway IoT service boots up it will publish it’s settings and the connected state will become true. Until the connected becomes true no operations can be performed on the gateway or devices.

The endpoint accepts only iot_approved. If any other fields are passed the endpoint will return error 400 Bad Request.

Request Key Explanation

Key Type Explanation
iot_approved boolean

The iot_approved will accept values between true/false.

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
	"iot_coex": true
}' "{{host}}/app/v1/gateway/30:87:D9:14:79:30/management/IOT_COEX"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/30:87:D9:14:79:30/management/IOT_COEX HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
	"iot_coex": true
}

Gateway COEX disable

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the IOT APPROVED of the IoT network in the AP. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/IOT_APPROVED

Once the API is called the iot_approved in the gateway is set and the IoT process will reboot. Once the API is called the gateway connected state as false. Once the gateway IoT service boots up it will publish it’s settings and the connected state will become true. Until the connected becomes true no operations can be performed on the gateway or devices.

The endpoint accepts only iot_approved. If any other fields are passed the endpoint will return error 400 Bad Request.

Request Key Explanation

Key Type Explanation
iot_approved boolean

The iot_approved will accept values between true/false.

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
	"iot_coex": false
}' "{{host}}/app/v1/gateway/30:87:D9:14:79:30/management/IOT_COEX"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/30:87:D9:14:79:30/management/IOT_COEX HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
	"iot_coex": false
}

Multiple Set Gateway coex

curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
  {
    "gateway_euid": "D8:38:FC:25:BB:67",
    "iot_coex": false
  },
  {
    "gateway_euid": "30:87:D9:14:79:30",
    "iot_coex": true
  }
]' "{{host}}/app/v1/gateway/management/IOT_COEX"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/IOT_COEX HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

[
  {
    "gateway_euid": "D8:38:FC:25:BB:67",
    "iot_coex": false
  },
  {
    "gateway_euid": "30:87:D9:14:79:30",
    "iot_coex": true
  }
]

Device Aggregation

These are the set of APIs which group different devices together based on a set of conditions and return aggregated data. Each API response will consist of a list of dictionaries with data pertaining to that specific API.

Dashboard DevicesType

This endpoint is a token-auth protected endpoint.

This endpoint is be used to get the count of different types of devices.

{{host}}app/v1/dashboard/devicetype

Based on the value of the device_type field for every document in the Device collection, different documents of the same device_type value will be grouped and their count will be returned along with the respective device_type value. The response is a list of dictionaries where each dictionary has the device_type and its related count.

Response Key Explanation

Key Type Explanation
_id int has the value for the device_type
count int quantifies the devices against this device_type

Expected status codes

Status Code Explanation
200 Request is processed successfully
404 Devices not found in RIoT
500 Critical Server Error
curl -X GET -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "http://{{url}}:{{port}}/app/v1/dashboard/devicetype"
failed to parse url
parse http://{{url}}:{{port}}/app/v1/dashboard/devicetype: invalid character "{" in host name

Dashboard DevicesByProtocol

This endpoint is a token-auth protected endpoint.

This endpoint is be used to get the count of different modes of devices.

{{host}}app/v1/dashboard/devicesbyprotocol

Based on the gateway against which each device is mapped, and the network mode of that gateway (ZIGBEE, BLE), different devices are grouped together on their operating mode. The response is a list of dictionaries where each dictionary has the device_type and its related count.

Response Key Explanation

Key Type Explanation
_id int has the value for the network_mode
count int quantifies the devices against this network mode

Expected status codes

Status Code Explanation
200 Request is processed successfully
404 Devices not found in RIoT
500 Critical Server Error
curl -X GET -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/dashboard/devicesbyprotocol"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/devicesbyprotocol HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

Dashboard DevicesByProvision

This endpoint is a token-auth protected endpoint.

This endpoint is be used to get the count of provisioned devices.

{{host}}app/v1/dashboard/devicesbyprovision

All the provisioned (where is_enabled is 1) and non provisioned devices will be grouped and their count will be returned.

Response Key Explanation

Key Type Explanation
_id int has the value for provision (0 or 1)
count int quantifies the provisioned and non provsioned devices

Expected status codes

Status Code Explanation
200 Request is processed successfully
404 Devices not found in RIoT
500 Critical Server Error
curl -X GET -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/dashboard/devicesbyprovision"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/devicesbyprovision HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

Device CRUD

These are the set of APIs through which a device or a group of devices can be managed. The device(s) can be added, modified or deleted by these APIs.

All Devices

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the detailed list of devices added under the account. These devices can be added manually from the Create Device API. All the devices which have communicated with RIoT will have extra details of the attributes which it supports, the type of device and other details.

Response Key Explanation

Key Type Explanation
device_tags Array Tags assigned to the device
device_name String Name given to the device
updated_on Timestamp The timestamp when the device was updated
created_on Timestamp The timestamp of when the device was created
connected Boolean The state whether the device is connected to RIoT
gateway_euid String The MAC address of the of the gateway under which the device is mapped
device_type String The type of device
blacklisted Boolean Whether the device is blacklisted by user
device_capability Dictionary Contains information of the Attributes supported by the device

The device capability is available only after the device has communicated with the RIoT controller. The contents of the device capability is as below:

{ ““:{ ““:{ “configured_value”: “The value configured by the user”, “reported_value”: “The value received by the gateway for the capability for the sensor type”, “reported_on”: “The timestamp of when the capability got reported by the gateway” } } }

If the blacklisted value is true. Then there will be no communication between the device anf the controller. By default the device type will be SENSOR. After the device communicates the device type will be updated to either LIGHT, LOCK, SWITCH or SMART_PLUG.

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Devices not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device"
GET %7B%7Bhost%7D%7D/app/v1/device HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionkeep-alive
Content-Length17742
Content-Typeapplication/json
DateWed, 21 Nov 2018 11:14:08 GMT
Servernginx
Strict-Transport-Securitymax-age=63072000
X-Frame-OptionsSAMEORIGIN
X-Frame-OptionsSAMEORIGIN
{
    "meta": {
        "query": "",
        "offset": 0,
        "limit": 0,
        "total_count": 5
    },
    "data": [
        {
            "device_tags": [
                "00:24:46:00:00:0E:5D:96",
                "thermostat-apr"
            ],
            "gateway_euid": "30:87:D9:14:79:90",
            "last_seen": 1542793660,
            "connected": false,
            "lqi": 255,
            "device_name": "thermostat-apr",
            "device_type": "Thermostat",
            "device_euid": "00:24:46:00:00:0E:5D:96",
            "updated_on": "2018-11-21T11:13:17.281000Z",
            "blacklisted": false,
            "rssi": -24,
            "created_on": "2018-11-21T09:10:07.345000Z"
        },
        {
            "device_tags": [
                "00:15:8D:00:01:A8:CD:83",
                "heiman-door-KR"
            ],
            "gateway_euid": "F0:3E:90:3F:89:00",
            "last_seen": 1542797335,
            "connected": true,
            "lqi": 255,
            "device_name": "heiman-door-KR",
            "device_type": "IAS Zone",
            "device_euid": "00:15:8D:00:01:A8:CD:83",
            "updated_on": "2018-11-21T11:13:16.910000Z",
            "device_zcl_capability": {
                "1": {
                    "0x0001": {
                        "parent_command": "",
                        "cluster_name": "Power Configuration",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x1E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "BatteryRatedVoltage",
                                "ui_control_id": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0034",
                                "access": 1
                            }
                        ],
                        "commands": {}
                    },
                    "0x0003": {
                        "parent_command": "zcl identify",
                        "cluster_name": "Identify",
                        "attributes": [],
                        "commands": {
                            "0x00": {
                                "params": [
                                    {
                                        "action": "10"
                                    }
                                ],
                                "sub_command": "ez-mode",
                                "ui_range_max": "0",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "12",
                                "ui_validator_regex": "na",
                                "ui_args": [
                                    {
                                        "ui_control_id": "11",
                                        "ui_range_max": "0",
                                        "name": "action",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": ""
                                    }
                                ],
                                "command_description": "Identify"
                            },
                            "0x01": {
                                "params": [],
                                "sub_command": "query",
                                "ui_range_max": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "0",
                                "ui_validator_regex": "na",
                                "ui_args": [],
                                "command_description": "Identify Query"
                            }
                        }
                    },
                    "0x0000": {
                        "cluster_name": "Basic",
                        "commands": {
                            "0x00": {
                                "params": [],
                                "sub_command": "rtfd",
                                "ui_range_max": "0",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": "TRUE",
                                "ui_range_min": "0",
                                "ui_control_id": "11",
                                "ui_validator_regex": "na",
                                "ui_args": [],
                                "command_description": "Reset to Factory Defaults"
                            }
                        },
                        "parent_command": "zcl basic",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x4845494D414E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "Manufacturer Name",
                                "ui_control_id": "1",
                                "ui_data_type": "ascii",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0004",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x02"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "StackVersion",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0002",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x01"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZCL Version",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "(Version)",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x323031382E322E3237"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "DateCode",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0006",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x10"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "HWVersion",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0003",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x446F6F7253656E736F722D4E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ModelIdentifier",
                                "ui_control_id": "1",
                                "ui_data_type": "ascii",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0005",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x03"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "Battery",
                                "ui_range_min": 0.0,
                                "attribute_name": "PowerSource",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0007",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x20"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "Application Version",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0001",
                                "access": 0
                            }
                        ]
                    },
                    "0x0500": {
                        "cluster_name": "IAS Zone",
                        "commands": {
                            "0x00": {
                                "params": [
                                    {
                                        "enroll": "0"
                                    },
                                    {
                                        "zone id": "0"
                                    }
                                ],
                                "sub_command": "enroll",
                                "ui_range_max": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "0",
                                "ui_validator_regex": "na",
                                "ui_args": [
                                    {
                                        "ui_control_id": "0",
                                        "ui_range_max": "0",
                                        "name": "enroll",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": "Zone Enroll Response "
                                    },
                                    {
                                        "ui_control_id": "0",
                                        "ui_range_max": "0",
                                        "name": "zone id",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": ""
                                    }
                                ],
                                "command_description": "Zone Enroll Response "
                            }
                        },
                        "parent_command": "zcl ias-zone",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x0020",
                                    "mapped_value": [
                                        {
                                            "Supervision reports (Note 1)": "Does not report",
                                            "Battery Defect": "Sensor battery is functioning normally",
                                            "Tamper": "not tampered",
                                            "Trouble": "OK",
                                            "Restore reports (Note 2)": "Report restore",
                                            "Battery": "Battery OK",
                                            "Alarm2": "2nd portal Open-Close closed or not alarmed",
                                            "Test": "Sensor is in operation mode",
                                            "AC (mains)": "AC/Mains OK",
                                            "Alarm1": "1st portal Open-Close closed or not alarmed"
                                        }
                                    ]
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZoneStatus",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0002",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x01"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "MeasurementType",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x0015"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "Contact switch",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZoneType",
                                "ui_control_id": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0001",
                                "access": 0
                            }
                        ]
                    }
                }
            },
            "blacklisted": false,
            "rssi": -35,
            "created_on": "2018-11-21T09:51:19.968000Z"
        },
        {
            "device_tags": [
                "00:15:8D:00:01:A8:CB:99",
                "heiman-temp-KR"
            ],
            "gateway_euid": "F0:3E:90:3F:89:00",
            "last_seen": 1542798564,
            "connected": true,
            "lqi": 252,
            "device_name": "heiman-temp-KR",
            "device_type": "Temperature Sensor",
            "device_euid": "00:15:8D:00:01:A8:CB:99",
            "updated_on": "2018-11-21T11:13:16.957000Z",
            "device_zcl_capability": {
                "1": {
                    "0x0402": {
                        "parent_command": "",
                        "cluster_name": "Temperature Measurement",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x09A6"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "MeasuredValue",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 2
                            }
                        ],
                        "commands": {}
                    },
                    "0x0003": {
                        "parent_command": "zcl identify",
                        "cluster_name": "Identify",
                        "attributes": [],
                        "commands": {
                            "0x00": {
                                "params": [
                                    {
                                        "action": "10"
                                    }
                                ],
                                "sub_command": "ez-mode",
                                "ui_range_max": "0",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "12",
                                "ui_validator_regex": "na",
                                "ui_args": [
                                    {
                                        "ui_control_id": "11",
                                        "ui_range_max": "0",
                                        "name": "action",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": ""
                                    }
                                ],
                                "command_description": "Identify"
                            },
                            "0x01": {
                                "params": [],
                                "sub_command": "query",
                                "ui_range_max": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "0",
                                "ui_validator_regex": "na",
                                "ui_args": [],
                                "command_description": "Identify Query"
                            }
                        }
                    },
                    "0x0000": {
                        "cluster_name": "Basic",
                        "commands": {
                            "0x00": {
                                "params": [],
                                "sub_command": "rtfd",
                                "ui_range_max": "0",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": "TRUE",
                                "ui_range_min": "0",
                                "ui_control_id": "11",
                                "ui_validator_regex": "na",
                                "ui_args": [],
                                "command_description": "Reset to Factory Defaults"
                            }
                        },
                        "parent_command": "zcl basic",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x4845494D414E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "Manufacturer Name",
                                "ui_control_id": "1",
                                "ui_data_type": "ascii",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0004",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x02"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "StackVersion",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0002",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x01"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZCL Version",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "(Version)",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x323031382E332E32"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "DateCode",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0006",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x10"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "HWVersion",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0003",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x343030302D30303031"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "SWBuildID",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x4000",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x48542D4E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ModelIdentifier",
                                "ui_control_id": "1",
                                "ui_data_type": "ascii",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0005",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x03"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "Battery",
                                "ui_range_min": 0.0,
                                "attribute_name": "PowerSource",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0007",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x18"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "Application Version",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0001",
                                "access": 0
                            }
                        ]
                    },
                    "0x0001": {
                        "parent_command": "",
                        "cluster_name": "Power Configuration",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x00"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "BatteryRatedVoltage",
                                "ui_control_id": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0034",
                                "access": 1
                            }
                        ],
                        "commands": {}
                    }
                },
                "2": {
                    "0x0405": {
                        "parent_command": "",
                        "cluster_name": "Relative Humidity",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x12F8"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "MeasuredValue",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 2
                            }
                        ],
                        "commands": {}
                    }
                }
            },
            "blacklisted": false,
            "rssi": -37,
            "created_on": "2018-11-21T10:14:39.272000Z"
        },
        {
            "device_tags": [
                "heiman-gas-KR",
                "00:15:8D:00:01:A8:D6:E0"
            ],
            "gateway_euid": "F0:3E:90:3F:89:00",
            "last_seen": 1542798706,
            "connected": true,
            "lqi": 252,
            "device_name": "heiman-gas-KR",
            "device_type": "IAS Zone",
            "device_euid": "00:15:8D:00:01:A8:D6:E0",
            "updated_on": "2018-11-21T11:13:16.928000Z",
            "device_zcl_capability": {
                "1": {
                    "0x0003": {
                        "parent_command": "zcl identify",
                        "cluster_name": "Identify",
                        "attributes": [],
                        "commands": {
                            "0x00": {
                                "params": [
                                    {
                                        "action": "10"
                                    }
                                ],
                                "sub_command": "ez-mode",
                                "ui_range_max": "0",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "12",
                                "ui_validator_regex": "na",
                                "ui_args": [
                                    {
                                        "ui_control_id": "11",
                                        "ui_range_max": "0",
                                        "name": "action",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": ""
                                    }
                                ],
                                "command_description": "Identify"
                            },
                            "0x01": {
                                "params": [],
                                "sub_command": "query",
                                "ui_range_max": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "0",
                                "ui_validator_regex": "na",
                                "ui_args": [],
                                "command_description": "Identify Query"
                            }
                        }
                    },
                    "0x0000": {
                        "cluster_name": "Basic",
                        "commands": {
                            "0x00": {
                                "params": [],
                                "sub_command": "rtfd",
                                "ui_range_max": "0",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": "TRUE",
                                "ui_range_min": "0",
                                "ui_control_id": "11",
                                "ui_validator_regex": "na",
                                "ui_args": [],
                                "command_description": "Reset to Factory Defaults"
                            }
                        },
                        "parent_command": "zcl basic",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x4845494D414E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "Manufacturer Name",
                                "ui_control_id": "1",
                                "ui_data_type": "ascii",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0004",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x02"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "StackVersion",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0002",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x01"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZCL Version",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "(Version)",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x323031382E332E3130"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "DateCode",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0006",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x10"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "HWVersion",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0003",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x47415353656E736F722D4E"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ModelIdentifier",
                                "ui_control_id": "1",
                                "ui_data_type": "ascii",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0005",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x01"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "Mains (single phase)",
                                "ui_range_min": 0.0,
                                "attribute_name": "PowerSource",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0007",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x12"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "Application Version",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": false,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0001",
                                "access": 0
                            }
                        ]
                    },
                    "0x0500": {
                        "cluster_name": "IAS Zone",
                        "commands": {
                            "0x00": {
                                "params": [
                                    {
                                        "enroll": "0"
                                    },
                                    {
                                        "zone id": "0"
                                    }
                                ],
                                "sub_command": "enroll",
                                "ui_range_max": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": "FALSE",
                                "ui_range_min": "0",
                                "ui_control_id": "0",
                                "ui_validator_regex": "na",
                                "ui_args": [
                                    {
                                        "ui_control_id": "0",
                                        "ui_range_max": "0",
                                        "name": "enroll",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": "Zone Enroll Response "
                                    },
                                    {
                                        "ui_control_id": "0",
                                        "ui_range_max": "0",
                                        "name": "zone id",
                                        "ui_unit": "na",
                                        "ui_is_show": "FALSE",
                                        "ui_data_type": "int",
                                        "ui_range_min": "0",
                                        "ui_validator_regex": "na",
                                        "command_description": ""
                                    }
                                ],
                                "command_description": "Zone Enroll Response "
                            }
                        },
                        "parent_command": "zcl ias-zone",
                        "attributes": [
                            {
                                "reported_value": {
                                    "value": "0x0030",
                                    "mapped_value": [
                                        {
                                            "Supervision reports (Note 1)": "Reports",
                                            "Battery Defect": "Sensor battery is functioning normally",
                                            "Tamper": "not tampered",
                                            "Restore reports (Note 2)": "Report restore",
                                            "Battery": "Battery OK",
                                            "Alarm2": "Cooking indication closed or not alarmed",
                                            "Test": "Sensor is in operation mode",
                                            "Alarm1": "CO indication closed or not alarmed",
                                            "AC (mains)": "AC/Mains OK",
                                            "Trouble": "OK"
                                        }
                                    ]
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZoneStatus",
                                "ui_control_id": "1",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0002",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x01"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "NA",
                                "ui_range_min": 0.0,
                                "attribute_name": "MeasurementType",
                                "ui_control_id": "1",
                                "ui_data_type": "string",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0000",
                                "access": 0
                            },
                            {
                                "reported_value": {
                                    "value": "0x002B"
                                },
                                "ui_range_max": 0.0,
                                "reported_value_name": "Carbon Monoxide (CO) sensor",
                                "ui_range_min": 0.0,
                                "attribute_name": "ZoneType",
                                "ui_control_id": "0",
                                "ui_data_type": "int",
                                "ui_unit": "na",
                                "ui_is_show": true,
                                "ui_validator_regex": "na",
                                "attribute_id": "0x0001",
                                "access": 0
                            }
                        ]
                    }
                }
            },
            "blacklisted": false,
            "rssi": -37,
            "created_on": "2018-11-21T10:24:38.605000Z"
        },
        {
            "device_tags": [
                "sengled",
                "B0:CE:18:14:03:02:CE:C5"
            ],
            "gateway_euid": "F0:3E:90:3F:89:00",
            "last_seen": 1542798634,
            "connected": true,
            "lqi": 132,
            "device_name": "sengled",
            "device_type": "Dimmable Light",
            "device_euid": "B0:CE:18:14:03:02:CE:C5",
            "updated_on": "2018-11-21T11:13:16.943000Z",
            "device_zcl_capability": {},
            "blacklisted": false,
            "rssi": -67,
            "created_on": "2018-11-21T10:43:38.397000Z"
        }
    ]
}
Status404 Not Found
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionclose
Content-Length103
Content-Typeapplication/json
DateWed, 26 Jul 2017 11:47:27 GMT
Servergunicorn/19.6.0
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "code": 404,
    "http_code": 404,
    "developer_message": null,
    "message": "Devices not found",
    "http_message": null
}

Query Devices

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the detailed list of devices added under the account. These devices can be added manually from the Create Device API. All the devices which have communicated with RIoT will have extra details of the attributes which it supports, the type of device and other details.

Response Key Explanation

Key Type Explanation
device_tags Array Tags assigned to the device
device_name String Name given to the device
updated_on Timestamp The timestamp when the device was updated
created_on Timestamp The timestamp of when the device was created
connected Boolean The state whether the device is connected to RIoT
gateway_euid String The MAC address of the of the gateway under which the device is mapped
device_type String The type of device
blacklisted Boolean Whether the device is blacklisted by user
device_capability Dictionary Contains information of the Attributes supported by the device

The device capability is available only after the device has communicated with the RIoT controller. The contents of the device capability is as below:

{ ““:{ ““:{ “configured_value”: “The value configured by the user”, “reported_value”: “The value received by the gateway for the capability for the sensor type”, “reported_on”: “The timestamp of when the capability got reported by the gateway” } } }

If the blacklisted value is true. Then there will be no communication between the device anf the controller. By default the device type will be SENSOR. After the device communicates the device type will be updated to either LIGHT, LOCK, SWITCH or SMART_PLUG.

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Devices not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device?limit=10&offset=0&gateway_euid=D8:38:FC:25:BB:60&connected=true&device_type=sensor&device_tags=assa abloy"
GET %7B%7Bhost%7D%7D/app/v1/device?limit=10&offset=0&gateway_euid=D8:38:FC:25:BB:60&connected=true&device_type=sensor&device_tags=assa abloy HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status404 Not Found
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionclose
Content-Length103
Content-Typeapplication/json
DateWed, 26 Jul 2017 11:47:27 GMT
Servergunicorn/19.6.0
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "code": 404,
    "http_code": 404,
    "developer_message": null,
    "message": "Devices not found",
    "http_message": null
}
Status200 OK
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length1144
Content-Typeapplication/json
DateTue, 25 Jul 2017 10:53:17 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
[
    {
        "device_name": "Demo Test Device",
        "device_type": "SENSOR",
        "device_capability": {
            "LIGHT": {
                "attributes": {
                    "BRIGHTNESS": {
                        "configured_value": {
                            "level": 255
                        },
                        "reported_value": {
                            "level": 254
                        }
                    },
                    "STATE": {
                        "configured_value": {
                            "on": 0
                        },
                        "reported_value": {
                            "on": 1
                        }
                    }
                }
            }
        },
        "created_on": "2017-05-31T12:34:31.400000Z",
        "updated_on": "2017-06-02T11:02:26.059000Z",
        "connected": true,
        "device_euid": "84:18:26:00:00:07:AB:55",
        "device_tags": [
            "121",
            "some-tag"
        ],
        "gateway_euid": "D8:38:FC:25:BB:60"
    },
    {
        "device_name": "Light",
        "device_type": "SENSOR",
        "created_on": "2017-07-21T13:10:02.693000Z",
        "updated_on": "Never",
        "connected": false,
        "device_euid": "84:18:26:00:00:07:AB:56",
        "device_tags": [
            "Osram"
        ],
        "gateway_euid": "D8:38:FC:25:BB:60"
    },
    {
        "device_name": "Light",
        "device_type": "SENSOR",
        "created_on": "2017-07-21T13:10:24.681000Z",
        "updated_on": "Never",
        "connected": false,
        "device_euid": "84:18:26:00:00:07:AB:57",
        "device_tags": [
            "Osram"
        ],
        "gateway_euid": "D8:38:FC:25:BB:60"
    },
    {
        "device_name": "Light",
        "device_type": "SENSOR",
        "created_on": "2017-07-21T13:11:38.660000Z",
        "updated_on": "Never",
        "connected": false,
        "device_euid": "84:18:26:00:00:07:AB:58",
        "device_tags": [
            "Osram"
        ],
        "gateway_euid": "D8:38:FC:25:BB:60"
    }
]

Search Devices

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the search devices added under the account. These devices can be added manually from the Create Device API. All the devices which have communicated with RIoT will have extra details of the attributes which it supports, the type of device and other details.

Response Key Explanation

Key Type Explanation
device_tags Array Tags assigned to the device
device_name String Name given to the device
updated_on Timestamp The timestamp when the device was updated
created_on Timestamp The timestamp of when the device was created
connected Boolean The state whether the device is connected to RIoT
gateway_euid String The MAC address of the of the gateway under which the device is mapped
device_type String The type of device
blacklisted Boolean Whether the device is blacklisted by user
device_capability Dictionary Contains information of the Attributes supported by the device

The device capability is available only after the device has communicated with the RIoT controller. The contents of the device capability is as below:

{ ““:{ ““:{ “configured_value”: “The value configured by the user”, “reported_value”: “The value received by the gateway for the capability for the sensor type”, “reported_on”: “The timestamp of when the capability got reported by the gateway” } } }

If the blacklisted value is true. Then there will be no communication between the device anf the controller. By default the device type will be SENSOR. After the device communicates the device type will be updated to either LIGHT, LOCK, SWITCH or SMART_PLUG.

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Devices not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device?limit=10&offset=0&gateway_euid=D8:38:FC:25:BB:60&connected=true&device_type=sensor&device_tags=assa abloy"
GET %7B%7Bhost%7D%7D/app/v1/device?limit=10&offset=0&gateway_euid=D8:38:FC:25:BB:60&connected=true&device_type=sensor&device_tags=assa abloy HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status404 Not Found
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionclose
Content-Length103
Content-Typeapplication/json
DateWed, 26 Jul 2017 11:47:27 GMT
Servergunicorn/19.6.0
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "code": 404,
    "http_code": 404,
    "developer_message": null,
    "message": "Devices not found",
    "http_message": null
}
Status200 OK
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length1144
Content-Typeapplication/json
DateTue, 25 Jul 2017 10:53:17 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "meta": {
        "total_count": 1,
        "offset": 0,
        "limit": 10,
        "query": "{'search_string': ['plu']}"
    },
    "data": [
        {
            "device_vdzg_info": [
                {
                    "gateway_iot_networks": [
                        {
                            "set_network_type": "zigbee",
                            "get_network_type": "zigbee"
                        }
                    ],
                    "gateway_ip_networks": [
                        {
                            "domain_id": "NA",
                            "ctl_host": "NA",
                            "zone_id": "NA",
                            "apgroup_id": "NA"
                        }
                    ]
                }
            ],
            "device_type": "Smart plug",
            "device_euid": "00:0B:57:FF:FE:1B:3B:64",
            "device_name": "plug",
            "device_zcl_capability": {
                "1": {
                    "0x0000": {
                        "attributes": [
                            {
                                "ui_is_show": true,
                                "ui_control_id": "0",
                                "access": 0,
                                "reported_value": "0x00",
                                "ui_unit": "na",
                                "attribute_name": "PowerSource",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0007",
                                "ui_validator_regex": "na",
                                "ui_data_type": "string",
                                "ui_range_min": 0.0
                            },
                            {
                                "ui_is_show": false,
                                "ui_control_id": "1",
                                "access": 0,
                                "reported_value": "0x53696C69636F6E4C616273",
                                "ui_unit": "na",
                                "attribute_name": "Manufacturer Name",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0004",
                                "ui_validator_regex": "na",
                                "ui_data_type": "string",
                                "ui_range_min": 0.0
                            },
                            {
                                "ui_is_show": false,
                                "ui_control_id": "1",
                                "access": 0,
                                "reported_value": "0x00",
                                "ui_unit": "na",
                                "attribute_name": "HWVersion",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0003",
                                "ui_validator_regex": "na",
                                "ui_data_type": "int",
                                "ui_range_min": 0.0
                            },
                            {
                                "ui_is_show": false,
                                "ui_control_id": "1",
                                "access": 0,
                                "reported_value": "0x536D6172744F75746C6574",
                                "ui_unit": "na",
                                "attribute_name": "ModelIdentifier",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0005",
                                "ui_validator_regex": "na",
                                "ui_data_type": "string",
                                "ui_range_min": 0.0
                            }
                        ],
                        "parent_command": "zcl basic",
                        "commands": {
                            "0x00": {
                                "ui_is_show": "TRUE",
                                "ui_control_id": "11",
                                "params": [],
                                "ui_unit": "na",
                                "ui_args": [],
                                "command_description": "Reset to Factory Defaults",
                                "ui_validator_regex": "na",
                                "sub_command": "rtfd",
                                "ui_data_type": "string",
                                "ui_range_min": "0",
                                "ui_range_max": "0"
                            }
                        }
                    },
                    "0x0702": {
                        "0x0000": {
                            "reported_value": {
                                "value": "0x000000000000"
                            },
                            "reported_on": "2018-10-23T09:43:58.003000"
                        }
                    },
                    "0x0B04": {
                        "0x0505": {
                            "reported_value": {
                                "value": "0xCE08"
                            },
                            "reported_on": "2018-10-23T09:44:47.767000"
                        },
                        "0x0508": {
                            "reported_value": {
                                "value": "0x0000"
                            },
                            "reported_on": "2018-10-23T09:43:42.478000"
                        }
                    },
                    "0x0400": {
                        "attributes": [
                            {
                                "ui_is_show": true,
                                "ui_control_id": "1",
                                "access": 0,
                                "reported_value": "0xD369",
                                "ui_unit": "na",
                                "attribute_name": "MeasuredValue",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0000",
                                "ui_validator_regex": "na",
                                "ui_data_type": "string",
                                "ui_range_min": 0.0
                            }
                        ],
                        "parent_command": "",
                        "commands": []
                    },
                    "0x0405": {
                        "attributes": [
                            {
                                "ui_is_show": true,
                                "ui_control_id": "1",
                                "access": 2,
                                "reported_value": "0x4310",
                                "ui_unit": "na",
                                "attribute_name": "MeasuredValue",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0000",
                                "ui_validator_regex": "na",
                                "ui_data_type": "string",
                                "ui_range_min": 0.0
                            }
                        ],
                        "parent_command": "",
                        "commands": []
                    },
                    "0x0402": {
                        "attributes": [
                            {
                                "ui_is_show": true,
                                "ui_control_id": "1",
                                "access": 2,
                                "reported_value": "0x570B",
                                "ui_unit": "na",
                                "attribute_name": "MeasuredValue",
                                "ui_range_max": 0.0,
                                "attribute_id": "0x0000",
                                "ui_validator_regex": "na",
                                "ui_data_type": "string",
                                "ui_range_min": 0.0
                            }
                        ],
                        "parent_command": "",
                        "commands": []
                    }
                }
            },
            "lqi": 255,
            "last_seen": 1540287843,
            "updated_on": "2018-10-23T09:44:06.361000",
            "gateway_euid": "D8:38:FC:22:22:10",
            "blacklisted": false,
            "created_on": "2018-10-23T09:06:55.036000",
            "device_tags": [
                "plug",
                "00:0B:57:FF:FE:1B:3B:64"
            ],
            "rssi": -31,
            "connected": true
        }
    ]
}

Single Device

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the details of a device requested under the account. The URL should contain the devices’ euid.

{{host}}app/v1/device/{device_euid}

This endpoint is used to get the detailed list of devices added under the account. These devices can be added manually from the Create Device API. All the devices which have communicated with RIoT will have extra details of the attributes which it supports, the type of device and other details.

Response Key Explanation

Key Type Explanation
device_tags Array Tags assigned to the device
device_name String Name given to the device
updated_on Timestamp The timestamp when the device was updated
created_on Timestamp The timestamp of when the device was created
connected Boolean The state whether the device is connected to RIoT
gateway_euid String The MAC address of the of the gateway under which the device is mapped
device_type String The type of device
blacklisted Boolean Whether the device is blacklisted by user
device_capability Dictionary Contains information of the Attributes supported by the device

The device capability is available only after the device has communicated with the RIoT controller. The contents of the device capability is as below:

{ ““:{ ““:{ “configured_value”: “The value configured by the user”, “reported_value”: “The value received by the gateway for the capability for the sensor type”, “reported_on”: “The timestamp of when the capability got reported by the gateway” } } }

If the blacklisted value is true. Then there will be no communication between the device anf the controller. By default the device type will be SENSOR. After the device communicates the device type will be updated to either LIGHT, LOCK, SWITCH or SMART_PLUG

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Device not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55"
GET %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55 HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200 OK
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length1144
Content-Typeapplication/json
DateTue, 25 Jul 2017 10:53:17 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "device_name": "Demo Test Device",
    "device_type": "SENSOR",
    "device_capability": {
        "LIGHT": {
            "attributes": {
                "BRIGHTNESS": {
                    "configured_value": {
                        "level": 255
                    },
                    "reported_value": {
                        "level": 254
                    }
                },
                "STATE": {
                    "configured_value": {
                        "on": 0
                    },
                    "reported_value": {
                        "on": 1
                    }
                }
            }
        }
    },
    "created_on": "2017-05-31T12:34:31.400000Z",
    "updated_on": "2017-06-02T11:02:26.059000Z",
    "connected": true,
    "device_euid": "84:18:26:00:00:07:AB:55",
    "device_tags": [
        "121",
        "some-tag"
    ],
    "gateway_euid": "D8:38:FC:25:BB:60"
}
Status404 Not Found
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length126
Content-Typeapplication/json
DateTue, 25 Jul 2017 11:42:08 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "http_message": null,
    "message": "Device 84:18:26:00:00:07:AB:89 not found",
    "http_code": 404,
    "code": 404,
    "developer_message": null
}

Create Device

This endpoint is a token-auth protected endpoint.

This endpoint is used to manually add a single device by providing required details for the device.

Request Key Explanation

Key Type Explanation
device_tags Array (optional) Tags to be assigned to the device
device_name String Name given to the device
device_euid String The MAC address or the identifier of the device
gateway_euid String The MAC address of the gateway under which the device is mapped

The device_name field can accept only a-zA-Z0-9 .:_- characters. By default, the device_name and the device_euid of the gateway will be added to the tags. The gateway_euid is mandatory while adding the device. It should be a valid gateway which exists in RIoT controller.

The endpoint accepts only device_tags, device_name, device_euid and gateway_euid. If any other fields are passed the endpoint will return error 400 Bad Request.

Response Key Explanation

Key Type Explanation
device_tags Array Tags assigned to the device
device_name String Name given to the device
updated_on Timestamp The timestamp when the device was updated
created_on Timestamp The timestamp of when the device was created
connected Boolean The state whether the device is connected to RIoT
gateway_euid String The MAC address of the gateway under which the device is mapped
device_type String The type of device
blacklisted Boolean Whether the device is blacklisted by user

After the device communicates with it’s attributes to RIoT, the details of the device will be available as seen in the All Devices API.

Expected status codes

Status Code Explanation
201 Device created successfully
400 Error in API body or validation failed for data provided
401 Invalid token
409 Device already exists with same device_euid
500 Critical Server Error
curl -X POST -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "device_euid":"00:0D:6F:00:05:24:20:CE",
  "device_name":"IBM Bulb 1",
  "gateway_euid":"D8:38:FC:25:BB:60",
  "device_tags":["Sample Tag"]
}' "{{host}}/app/v1/device"
POST %7B%7Bhost%7D%7D/app/v1/device HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "device_euid":"00:0D:6F:00:05:24:20:CE",
  "device_name":"IBM Bulb 1",
  "gateway_euid":"D8:38:FC:25:BB:60",
  "device_tags":["Sample Tag"]
}
Status201 Created
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length239
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:09:46 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "device_type": "SENSOR",
    "device_name": "Sample Device",
    "device_euid": "84:18:26:00:00:07:AB:50",
    "gateway_euid": "D8:38:FC:25:BB:60",
    "device_tags": [
        "Sample Tag"
    ],
    "created_on": "2017-07-25T12:09:46.271772",
    "connected": false,
    "updated_on": "Never"
}
Status400 Bad Request
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length189
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:10:30 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "http_message": null,
    "http_code": 400,
    "message": "Invalid data for fields {'device_euid': ['Device EUID invalid'], 'gateway_euid': ['Gateway not found']}",
    "developer_message": null,
    "code": 400
}

Update Device

This endpoint is a token-auth protected endpoint.

This endpoint is used to edit a single device by providing required details for the device. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}

Once the device is added the device_euid field cannot be modified. If any wrong device_euid is added then delete the particular device and add it again.

Request Key Explanation

Key Type Explanation
device_tags Array (optional) Tags to be assigned to the device
device_name String (optional) Name given to the device
gateway_euid String (optional) The new gateway under which the device should be shifted to
blacklist Boolean (optional) To blacklist the particular device from any communication with RIoT

The device_name field can accept only a-zA-Z0-9 .:_- characters. Only the field which need to be edited can be passed to the endpoint. There are no mandatory fields.

If device tags are not mentioned in the body it will retain the previous tags else it will overwrite the previous tags.

The endpoint accepts only device_tags, device_name, blacklist and gateway_euid. If any other fields are passed the endpoint will return error 400 Bad Request.

Response Key Explanation

Key Type Explanation
device_tags Array Tags assigned to the device
device_name String Name given to the device
updated_on Timestamp The timestamp when the device was updated
created_on Timestamp The timestamp of when the device was created
connected Boolean The state whether the device is connected to RIoT
gateway_euid String The MAC address of the gateway under which the device is mapped

After the device communicates with it’s settings to RIoT, the details of the device will be available as seen in the All Devices API.

Expected status codes

Status Code Explanation
200 Device edited successfully
400 Error in API body or validation failed for data provided
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "device_name": "Light",
  "gateway_euid": "EC:8C:A2:37:03:A0",
  "device_tags":["123","some-tag"],
  "blacklist": false
}' "{{host}}/app/v1/device/84:18:26:00:00:07:AB:58"
PUT %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:58 HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "device_name": "Light",
  "gateway_euid": "EC:8C:A2:37:03:A0",
  "device_tags":["123","some-tag"],
  "blacklist": false
}
Status200 OK
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length236
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:12:28 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "device_type": "SENSOR",
    "device_name": "Light",
    "device_euid": "84:18:26:00:00:07:AB:58",
    "gateway_euid": "D8:38:FC:25:BB:60",
    "device_tags": [
        "123",
        "some-tag"
    ],
    "created_on": "2017-07-21T13:11:38.660000Z",
    "connected": false,
    "updated_on": "Never"
}
Status404 Not Found
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length126
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:22:01 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "http_message": null,
    "http_code": 404,
    "message": "Device 84:18:26:00:00:07:AB:52 not found",
    "developer_message": null,
    "code": 404
}
Status404 Not Found
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length121
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:15:07 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "http_message": null,
    "http_code": 404,
    "message": "Gateway D8:38:FC:25:BB:62 not found",
    "developer_message": null,
    "code": 404
}

Delete Device

This endpoint is a token-auth protected endpoint.

This endpoint is used to delete a single device by providing required details for the device. The URL should contain the gateways’ euid

{{host}}app/v1/device/{device_euid}

Once the device is deleted it will be available to all the gateways in the network to join again. The device can join only the gateway with the network supported by the device.

Devices once deleted cannot be retrieved.

The endpoint accepts nothing in the API body.

Expected status codes

Status Code Explanation
204 Device deleted successfully
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X DELETE -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" "{{host}}/app/v1/device/00:0D:6F:00:03:1D:85:5F"
DELETE %7B%7Bhost%7D%7D/app/v1/device/00:0D:6F:00:03:1D:85:5F HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json
Status200 OK
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length0
DateTue, 25 Jul 2017 12:19:25 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
Status404 Not Found
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length126
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:20:10 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "http_message": null,
    "http_code": 404,
    "message": "Device 84:18:26:00:00:07:AB:52 not found",
    "developer_message": null,
    "code": 404
}

Patch Add Device

curl -X PATCH -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Token {{auth_token}}" -F "filename=" "{{host}}/app/v1/device?op=add"
PATCH %7B%7Bhost%7D%7D/app/v1/device?op=add HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="filename"


----WebKitFormBoundary7MA4YWxkTrZu0gW

Patch Update Device

curl -X PATCH -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Token {{auth_token}}" -F "filename=" "{{host}}/app/v1/device?op=update"
PATCH %7B%7Bhost%7D%7D/app/v1/device?op=update HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="filename"


----WebKitFormBoundary7MA4YWxkTrZu0gW

Patch Delete Device

curl -X PATCH -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Token {{auth_token}}" -F "filename=" "{{host}}/app/v1/device?op=delete"
PATCH %7B%7Bhost%7D%7D/app/v1/device?op=delete HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="filename"


----WebKitFormBoundary7MA4YWxkTrZu0gW

Device Capability

These are the set of APIs which control the IoT devices via the RIoT gateway.

Get Capabilites

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the capabilities supported by the device which have communicated with the RIoT controller. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/capability

Response Key Explanation

Key Type Explanation
supported_capabilities Array Capabilities supported by the device

supported_capabilities can contain either of thses values STATE, BRIGHTNESS, COLOR and LOCK_STATE. If the device has not communicated with the RIoT controller, an empty list will be returned.

The endpoint accepts nothing in the API body.

Expected status codes

Status Code Explanation
200 Device capabilities read successfully
401 Invalid token
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55/capability"
GET %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55/capability HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200 OK
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length47
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:23:46 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "supported_capability": [
        "BRIGHTNESS",
        "STATE"
    ]
}

Set State Capability

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the state of the device. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/capability/STATE

The state of the device can be controlled by this API. The device should have communicated prior of controlling the state. Also the capability should be supported by the device for the operation to happen.

Request Key Explanation

Key Type Explanation
on Boolean Set the state of the device

The on field can accept only boolean values. If set to true the device will switch on and vice versa.

The endpoint accepts only on in the body. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Device command queued successfully
400 Error in API body or validation failed for data provided
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "on": true
}' "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55/capability/STATE"
PUT %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55/capability/STATE HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "on": true
}
Status400 Bad Request
{
    "http_message": null,
    "http_code": 400,
    "message": "STATE capability is not supported by this device",
    "developer_message": null,
    "code": 400
}
Status200 OK
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length21
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:46:23 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "message": "success"
}

Set Brightness Capability

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the brightness of the device. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/capability/BRIGHTNESS

The brightness of the device can be controlled by this API. The device should have communicated prior of controlling the state. Also the capability should be supported by the device for the operation to happen.

Request Key Explanation

Key Type Explanation
level Integer Set the brightness of the device

The level field can accept only integer values between 0-255 where 0 is the lowest and 255 is the highest.

The endpoint accepts only level in the body. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Device command queued successfully
400 Error in API body or validation failed for data provided
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "level": 255
}' "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55/capability/BRIGHTNESS"
PUT %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55/capability/BRIGHTNESS HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "level": 255
}
Status200 OK
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length21
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:48:34 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "message": "success"
}
Status400 Bad Request
{
    "http_message": null,
    "http_code": 400,
    "message": "BRIGHTNESS capability is not supported by this device",
    "developer_message": null,
    "code": 400
}

ZCL Attribute Value

curl -X GET -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device/00:0D:6F:00:03:1D:85:5F/zclattribute?clust_id=0x0101&attr_id=0x0000"
GET %7B%7Bhost%7D%7D/app/v1/device/00:0D:6F:00:03:1D:85:5F/zclattribute?clust_id=0x0101&attr_id=0x0000 HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

ZCL Capability

curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
 "parent_command": "zcl basic",
 "command_id": "0x00",
 "cluster_id": "0x0000",
 "attribute_id": "0x00",
 "endpoint_id" : 1,
 "params": {"pin":5678}
}' "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55/capability/COLOR"
PUT %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55/capability/COLOR HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
 "parent_command": "zcl basic",
 "command_id": "0x00",
 "cluster_id": "0x0000",
 "attribute_id": "0x00",
 "endpoint_id" : 1,
 "params": {"pin":5678}
}

Set Color Capability

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the RGB color of the device. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/capability/COLOR

The RGB Color of the device can be controlled by this API. The device should have communicated prior of controlling the state. Also the capability should be supported by the device for the operation to happen.

Request Key Explanation

Key Type Explanation
red Integer Set the red color intensity of the device
green Integer Set the green color intensity of the device
blue Integer Set the blue color intensity of the device

The red, green and blue field can accept only integer values between 0-255 where 0 is the lowest and 255 is the highest.

The endpoint accepts only red, green and blue in the body. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Device command queued successfully
400 Error in API body or validation failed for data provided
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "red": 255,
  "green": 255,
  "blue": 255
}' "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55/capability/COLOR"
PUT %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55/capability/COLOR HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "red": 255,
  "green": 255,
  "blue": 255
}
Status401 Unauthorized
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length134
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:51:10 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "http_message": null,
    "http_code": 401,
    "message": "COLOR capability is not supported by this device",
    "developer_message": null,
    "code": 401
}
Status200 OK
{
    "message": "success"
}

Set Lock State Capability

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the lock state of the device. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/capability/LOCK_STATE

The lock state of the device can be controlled by this API. The device should have communicated prior of controlling the state. Also the capability should be supported by the device for the operation to happen.

Request Key Explanation

Key Type Explanation
lock Boolean Set the state of the device

The lock field can accept only boolean values. If set to true the device will lock and vice versa.

The endpoint accepts only lock in the body. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Device command queued successfully
400 Error in API body or validation failed for data provided
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "lock": true
}' "{{host}}/app/v1/device/00:0D:6F:00:03:1D:85:5F/capability/LOCK_STATE"
PUT %7B%7Bhost%7D%7D/app/v1/device/00:0D:6F:00:03:1D:85:5F/capability/LOCK_STATE HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "lock": true
}
Status200 OK
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length139
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:56:37 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "message": "success"
}
Status400 Bad Request
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length139
Content-Typeapplication/json
DateTue, 25 Jul 2017 13:07:08 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "developer_message": null,
    "code": 400,
    "http_code": 400,
    "message": "LOCK_STATE capability is not supported by this device",
    "http_message": null
}

Multiple Devices Set Capability

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the capability of multiple devices by providing details of the device and the values for the capabilities.

Request Explanation

The request body will be a list of dictionaries. Each dictionary should specify the keys below :

Key Type Explanation
device_euid String The MAC address or the identifier of the device
capability String Capability supported by the device
value String The MAC address or the identifier of the gateway

The capability field can accept any one of the strings : ‘STATE’, ‘BRIGHTNESS’, ‘COLOUR’, ‘LOCK_STATE’.

The value field will contain the value to set the capability to.

Capability Value
STATE {“on”:true / false}
BRIGHTNESS {“level”:255}
COLOUR {“red”: 255, “green”: 255, “blue”: 255}
LOCK_STATE {“lock”:true / false}

The endpoint accepts only device_euid, capability and value. If any other fields are passed the endpoint will return error 400 Bad Request.

Response Explanation

For each device, the value of the capability will be set. The status of the capability can be known by querying the different devices.

A 200 OK response is sent if the request is successful.

Expected status codes

Status Code Explanation
200 Devices will set the capabilities according to the values given in the request
400 Error in API body or validation failed for data provided
401 Invalid token
500 Critical Server Error
curl -X PATCH -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '[
  {
    "device_euid": "00:0D:6F:00:05:24:20:CE",
    "capability": "STATE",
    "value": {
      "on": true
    }
  },
  {
    "device_euid": "*",
    "capability": "STATE",
    "value": {
      "on": false
    }
  },
  {
    "device_euid": "00:0D:6F:00:05:24:20:CE",
    "capability": "STATE",
    "value": {
      "on": true
    }
  },
  {
    "device_euid": "*",
    "capability": "STATE",
    "value": {
      "on": false
    }
  },
  {
    "device_euid": "*",
    "capability": "STATE",
    "value": {
      "on": false
    }
  }
]' "{{host}}/app/v1/device/capability"
PATCH %7B%7Bhost%7D%7D/app/v1/device/capability HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

[
  {
    "device_euid": "00:0D:6F:00:05:24:20:CE",
    "capability": "STATE",
    "value": {
      "on": true
    }
  },
  {
    "device_euid": "*",
    "capability": "STATE",
    "value": {
      "on": false
    }
  },
  {
    "device_euid": "00:0D:6F:00:05:24:20:CE",
    "capability": "STATE",
    "value": {
      "on": true
    }
  },
  {
    "device_euid": "*",
    "capability": "STATE",
    "value": {
      "on": false
    }
  },
  {
    "device_euid": "*",
    "capability": "STATE",
    "value": {
      "on": false
    }
  }
]

Device Management

These are the set of APIs to do operations on the device. In RIoT, devices refer to the IoT devices/endpoints in the IoT network environment. These device APIs can be used to control a single device or a group of devices. These API accept a set of values in the HTTP body. Every value is validated and then processed by the API.

Device Scan

These are the set of APIs which communicate to the RIoT gateway. These set of APIs can also be used for building custom dashboards and knowing the stats of the gateway.

Variable Explanation

gateway_euid The gateway MAC address or the identifier address
gateway_name This is the name for the gateway
gateway_tags These are the custom tags given to the gateway by the user
network_info This field contains the details of the IoT network on which the gateway is operating
diagnostics_info This field contains the diagnostics info of the gateway
ip_network_info This field contains the IP network information of the gateway
created_on This is the timestamp when the gateway was created
updated_on This is the time stamp when the gateway was updated

Get Scan List

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the list of devices scanned by the gateway durring the device scan operation. The URL should contain the gateways’ euid.

{{host}}app/v1/scan/get

The API will return the list of devices scanned. The scan list will get refreshed for every 3 minutes. The devices will be removed from the list once they are discovered after a duration of 3 minutes. For adding more devices, initiate the device scan operation for the gateway again. Expected status codes

Status Code Explanation
200 Gateway command queued successfully
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway/scan"
GET %7B%7Bhost%7D%7D/app/v1/gateway/scan HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200
{
    "device_list": {
        "0C:F4:D5:1C:52:50": [
            {
                "device_euid": "7C:B0:3E:AA:00:A4:50:08",
                "gateway_euid": "0C:F4:D5:1C:52:50",
                "manufacturer_name": "OSRAM",
                "device_serial": "11111111"
            }
        ]
    },
    "gateway_names": [
        "RuckusAP_02"
    ],
    "is_scanning": true,
    "scan_duration": 720,
    "scan_start_time": "1531131353.056579"
}

Start Scan for Device

This endpoint is a token-auth protected endpoint.

This endpoint is used initiate the device scan operation in the gateway for a specified duration. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/scan

The API will start the device scan operation for the specified gateway. Once the command initiated, new devices which are not in RIoT will respond to the particular gateway. These new devices can be viewed by providing the get request to the same API.

Request Key Explanation

Key Type Explanation
scan_duration Integer The duration for which the device scan duration should be activated

The scan_duration will accept Integer values between 10-250

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[{
"gateway_euid":"EC:8C:A2:37:03:A0",
"value":"ON"
},
{
"gateway_euid":"0C:F4:D5:1C:52:50",
"value":"ON"
}]' "{{host}}/app/v1/gateway/scan/start"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/scan/start HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

[{
"gateway_euid":"EC:8C:A2:37:03:A0",
"value":"ON"
},
{
"gateway_euid":"0C:F4:D5:1C:52:50",
"value":"ON"
}]

Stop Scan for Device

This endpoint is a token-auth protected endpoint.

This endpoint is used initiate the device scan operation in the gateway for a specified duration. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/scan

The API will start the device scan operation for the specified gateway. Once the command initiated, new devices which are not in RIoT will respond to the particular gateway. These new devices can be viewed by providing the get request to the same API.

Request Key Explanation

Key Type Explanation
scan_duration Integer The duration for which the device scan duration should be activated

The scan_duration will accept Integer values between 10-250

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X POST -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway/scan/stop"
POST %7B%7Bhost%7D%7D/app/v1/gateway/scan/stop HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

Device ZCL Capability

Get ZCL Capabilites

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the capabilities supported by the device which have communicated with the RIoT controller. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/zclcapability

Response Key Explanation

Key Type Explanation
supported_capabilities Array Capabilities supported by the device

supported_capabilities can contain either of thses values STATE, BRIGHTNESS, COLOR and LOCK_STATE. If the device has not communicated with the RIoT controller, an empty list will be returned.

The endpoint accepts nothing in the API body.

Expected status codes

Status Code Explanation
200 Device capabilities read successfully
401 Invalid token
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device/84:18:26:00:00:07:AB:55/capability"
GET %7B%7Bhost%7D%7D/app/v1/device/84:18:26:00:00:07:AB:55/capability HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200 OK
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length47
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:23:46 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "supported_zcl_capability": [
        {
            "0x0008": [
                "0x00",
                "0x01"
            ]
        }
    ]
}

Set ZCL Capability

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the state of the device. The URL should contain the devices’ euid

{{host}}app/v1/device/{device_euid}/zclcapability/

The state of the device can be controlled by this API. The device should have communicated prior of controlling the state. Also the capability should be supported by the device for the operation to happen.

Request Key Explanation

Key Type Explanation
on Boolean Set the state of the device

The on field can accept only boolean values. If set to true the device will switch on and vice versa.

The endpoint accepts only on in the body. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Device command queued successfully
400 Error in API body or validation failed for data provided
404 Device not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "on": true
}' "{{host}}/app/v1/device/00:0D:6F:00:05:24:20:CE/zclcapability"
PUT %7B%7Bhost%7D%7D/app/v1/device/00:0D:6F:00:05:24:20:CE/zclcapability HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "on": true
}
Status400 Bad Request
{
    "http_message": null,
    "http_code": 400,
    "message": "STATE capability is not supported by this device",
    "developer_message": null,
    "code": 400
}
Status200 OK
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length21
Content-Typeapplication/json
DateTue, 25 Jul 2017 12:46:23 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "parent_command": "zcl level-control",
    "command_id": "0x00",
    "cluster_id": "0x0008",
    "params": {
        "level": 100
    }
}

Events

Events

This endpoint is a token-auth protected endpoint.

This endpoint is used to get an entire log file or the last n lines of the log file.

{{host}}/app/v1/dashboard/insights/

This API is used to get the entire log file

{{host}}/app/v1/dashboard/insights?line_num=n

This API is used to get the last n lines of the log file

Response Key Explanation

Key Type Explanation
log String Last n lines of the log file or the path to the log file

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
400 Bad Request
404 Log file not found
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/dashboard/insights"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/insights HTTP/1.1
Host: 
Authorization: Token {{auth_token}}

Gateway CRUD

These are the set of APIs which enable CRUD operations for the gateways in RIoT controller.

All Gateways

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the detailed list of gateways added under the account. These gateways can either be added automatically to RIoT or manually from the Create Gateway API. All the gateways which are automatically added have their names like Auto Created . All the gateways which have communicated with RIoT will have extra details of the network and IoT network information.

Response Key Explanation

Key Type Explanation
gateway_tags Array Tags assigned to the gateway
gateway_name String Name given to the gateway
updated_on Timestamp The timestamp when the gateway was updated
created_on Timestamp The timestamp of when the gateway was created
connected Boolean The state whether the gateway is connected to RIoT
gateway_euid String The MAC address or the identifier of the gateway
ip_network_info Array Contains the information of the IP network
netmask String Netmask Address of the Access point
ip String IP Address of the Access point
mac String MAC Address of the Access point
dns Array Array of DNS servers of the Access point
gateway String Gateway Address of the Access point
network_info Array Contains information of the IoT Network
get_radio_tx_power Integer The radio TX power of the IoT Dongle
network_mac String The MAC address of the IoT Dongle
network_type String The type of IoT network either ble or zigbee
set_radio_channel Integer The radio channel of the IoT Dongle
network_id String The IoT radio network address
set_radio_tx_power Integer The radio TX power of the IoT Dongle
get_radio_channel Integer The radio channel of the IoT Dongle
diagnostics_info Array Contains the diagnostics information of the gateway
memory_usage String RAM usage of the gateway
mqtt_qos String MQTT QoS set for communication to the MQTT Broker
network_type String Type of IoT network initiated
network_stack String The name of the IoT network stack
network_stack_ver String The version of the IoT network stack
ap_up_time String Time lapsed from the AP bootup
interface_name String The interface through which the IoT network is initiated
cpu_usage String The percentage use of the CPU
gateway_up_time String Time lapsed from the IoT Gateway bootup

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Gateways not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway"
GET %7B%7Bhost%7D%7D/app/v1/gateway HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status401
allowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
content-length63
content-typeapplication/json
dateMon, 04 Sep 2017 15:44:19 GMT
serverWSGIServer/0.2 CPython/3.5.2
www-authenticatetoken
x-frame-optionsSAMEORIGIN
{
    "detail": "Access Token Expired. Please refresh Access token."
}
Status200
allowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
content-length3172
content-typeapplication/json
dateMon, 04 Sep 2017 15:23:47 GMT
serverWSGIServer/0.2 CPython/3.5.2
x-frame-optionsSAMEORIGIN
{
    "meta": {
        "query": "",
        "offset": 0,
        "limit": 0,
        "total_count": 14
    },
    "data": [
        {
            "gateway_euid": "0C:F4:D5:1E:97:D0",
            "gateway_name": "CM_H510_iot-123",
            "approved": true,
            "connected": true,
            "gateway_tags": [
                "RuckusAP",
                "0C:F4:D5:1E:97:D0"
            ],
            "network_info": {
                "get_radio_channel": 25,
                "get_network_id": "0x1234",
                "set_radio_channel": 25,
                "set_network_type": "zigbee",
                "set_network_id": "0x1234",
                "set_iot_coex": false,
                "get_network_type": "zigbee",
                "network_mac": "90:FD:9F:FF:FE:7C:32:35",
                "get_radio_tx_power": 6,
                "set_radio_tx_power": 6,
                "get_iot_coex": false
            },
            "diagnostics_info": {
                "mqtt_qos": "2",
                "network_type": "zigbee",
                "ap_up_time": "6 days, 4:36:32",
                "gateway_up_time": "0 days, 1:16:58",
                "interface_name": "/dev/ttyUSB0",
                "memory_usage": "5320 bytes",
                "network_stack": "EZSP",
                "cpu_usage": "0.010000%",
                "network_stack_ver": "6.4.0.385"
            },
            "updated_on": "2018-11-21T11:00:33.357000Z",
            "ip_network_info": {
                "country_code": "WW",
                "dns": [
                    " 172.17.17.16"
                ],
                "domain_name": "Administration Domain",
                "apgroup_name": "wifi-5g",
                "netmask": "255.255.255.0",
                "gateway": "192.168.100.1",
                "set_vlan_enable": 0,
                "mac": "0C:F4:D5:1E:97:D0",
                "get_vlan_enable": 0,
                "set_vlan_id": 1,
                "gateway_name": "vriot",
                "zone_name": "Shzone",
                "ctl_host": "Shclust",
                "domain_id": "8b2081d5-9662-40d9-a3db-2a3cf4dde3f7",
                "ip": "192.168.100.92",
                "get_vlan_id": 1,
                "zone_id": "1eb3d38d-24bf-4a3f-bb6e-166bba13415f",
                "apgroup_id": "a682f95f-998e-417a-a2cd-35402712794f"
            },
            "device_info": [],
            "created_on": "2018-11-12T10:29:04.902000Z"
        },
        {
            "gateway_euid": "94:F6:65:2A:3B:B0",
            "gateway_name": "PM_RuckusAP-R610-BoRROWED",
            "approved": true,
            "connected": true,
            "gateway_tags": [
                "PM_RuckusAP-R610-BoRROWED",
                "94:F6:65:2A:3B:B0"
            ],
            "network_info": {
                "get_radio_channel": 20,
                "set_iot_coex": false,
                "get_network_id": "0x1234",
                "set_radio_channel": 20,
                "set_network_id": "0x1234",
                "get_network_type": "zigbee",
                "set_network_type": "zigbee",
                "network_mac": "90:FD:9F:FF:FE:7C:33:E2",
                "get_radio_tx_power": 6,
                "set_radio_tx_power": 6,
                "get_iot_coex": false
            },
            "diagnostics_info": {
                "mqtt_qos": "2",
                "network_type": "zigbee",
                "ap_up_time": "2 days, 4:05:26",
                "gateway_up_time": "0 days, 1:16:58",
                "interface_name": "/dev/ttyUSB0",
                "memory_usage": "6724 bytes",
                "network_stack": "EZSP",
                "cpu_usage": "0.150000%",
                "network_stack_ver": "6.4.0.385"
            },
            "updated_on": "2018-11-21T11:00:26.838000Z",
            "ip_network_info": {
                "country_code": "WW",
                "dns": [
                    " 172.17.17.16"
                ],
                "domain_name": "Administration Domain",
                "apgroup_name": "R610g_tEST",
                "netmask": "255.255.255.0",
                "gateway": "192.168.100.1",
                "set_vlan_enable": 0,
                "mac": "94:F6:65:2A:3B:B0",
                "get_vlan_enable": 0,
                "set_vlan_id": 1,
                "gateway_name": "PM_RuckusAP-R610-BoRROWED",
                "zone_name": "Shzone",
                "ctl_host": "Shclust",
                "domain_id": "8b2081d5-9662-40d9-a3db-2a3cf4dde3f7",
                "ip": "192.168.100.53",
                "get_vlan_id": 1,
                "zone_id": "1eb3d38d-24bf-4a3f-bb6e-166bba13415f",
                "apgroup_id": "59af00da-0854-47e7-a0a0-42492f365222"
            },
            "device_info": {
                "network_id": "FFFF",
                "lqi": 0,
                "last_seen": 0,
                "auth_state": 3,
                "rssi": 0,
                "device_euid": "00:00:F4:04:4C:0C:58:33"
            },
            "created_on": "2018-11-16T04:33:52.978000Z"
        },
        {
            "gateway_euid": "D8:38:FC:38:4B:70",
            "gateway_name": "RuckusAP_R610_test_vriot-lab",
            "approved": true,
            "connected": true,
            "gateway_tags": [
                "D8:38:FC:38:4B:70",
                "RuckusAP_R610_test_vriot-lab"
            ],
            "network_info": {
                "get_radio_channel": 15,
                "get_network_id": "0x1234",
                "set_radio_channel": 15,
                "set_network_type": "zigbee",
                "set_network_id": "0x1234",
                "set_iot_coex": false,
                "get_network_type": "zigbee",
                "network_mac": "90:FD:9F:FF:FE:7C:2D:0B",
                "get_radio_tx_power": 5,
                "set_radio_tx_power": 5,
                "get_iot_coex": false
            },
            "diagnostics_info": {
                "mqtt_qos": "2",
                "network_type": "zigbee",
                "ap_up_time": "5 days, 1:47:37",
                "gateway_up_time": "0 days, 1:16:57",
                "interface_name": "/dev/ttyUSB0",
                "memory_usage": "5668 bytes",
                "network_stack": "EZSP",
                "cpu_usage": "0.010000%",
                "network_stack_ver": "6.4.0.385"
            },
            "updated_on": "2018-11-21T11:00:23.726000Z",
            "ip_network_info": {
                "country_code": "WW",
                "dns": [
                    " 172.17.17.16"
                ],
                "domain_name": "Administration Domain",
                "apgroup_name": "R610g_tEST",
                "netmask": "255.255.255.0",
                "gateway": "192.168.100.1",
                "set_vlan_enable": 0,
                "mac": "D8:38:FC:38:4B:70",
                "get_vlan_enable": 0,
                "set_vlan_id": 1,
                "gateway_name": "RuckusAP_R610_test_vriot-lab",
                "zone_name": "Shzone",
                "ctl_host": "Shclust",
                "domain_id": "8b2081d5-9662-40d9-a3db-2a3cf4dde3f7",
                "ip": "192.168.100.32",
                "get_vlan_id": 1,
                "zone_id": "1eb3d38d-24bf-4a3f-bb6e-166bba13415f",
                "apgroup_id": "59af00da-0854-47e7-a0a0-42492f365222"
            },
            "device_info": [],
            "created_on": "2018-11-21T04:17:02.776000Z"
        },
        {
            "gateway_euid": "30:87:D9:14:79:90",
            "gateway_name": "AP",
            "approved": true,
            "connected": true,
            "gateway_tags": [
                "30:87:D9:14:79:90"
            ],
            "network_info": {
                "get_radio_channel": 25,
                "get_network_id": "0x345A",
                "set_radio_channel": 25,
                "set_network_type": "zigbee",
                "set_network_id": "0x345A",
                "set_iot_coex": false,
                "get_network_type": "zigbee",
                "network_mac": "90:FD:9F:FF:FE:0C:89:3E",
                "get_radio_tx_power": 6,
                "set_radio_tx_power": 6,
                "get_iot_coex": false
            },
            "diagnostics_info": {
                "mqtt_qos": "2",
                "network_type": "zigbee",
                "ap_up_time": "0 days, 2:02:30",
                "gateway_up_time": "0 days, 0:03:03",
                "interface_name": "/dev/ttyUSB0",
                "memory_usage": "4516 bytes",
                "network_stack": "EZSP",
                "cpu_usage": "0.050000%",
                "network_stack_ver": "6.4.0.385"
            },
            "updated_on": "2018-11-21T11:00:23.985000Z",
            "ip_network_info": {
                "country_code": "WW",
                "dns": [
                    " 10.10.10.10"
                ],
                "ctl_host": "clust",
                "apgroup_name": "default",
                "netmask": "255.255.252.0",
                "gateway": "10.22.139.254",
                "set_vlan_enable": 0,
                "mac": "30:87:D9:14:79:90",
                "get_vlan_enable": 0,
                "set_vlan_id": 1,
                "gateway_name": "AP",
                "zone_name": "Zone1",
                "domain_id": "8b2081d5-9662-40d9-a3db-2a3cf4dde3f7",
                "domain_name": "Administration Domain",
                "ip": "10.22.136.38",
                "get_vlan_id": 1,
                "zone_id": "d6d1855c-c871-443b-baf0-4e4202480bba",
                "apgroup_id": "77a47e41-dfa7-4991-86e9-d5c54832052a"
            },
            "device_info": [],
            "created_on": "2018-11-21T09:04:40.272000Z"
        },
        {
            "gateway_euid": "30:87:D9:14:57:A0",
            "gateway_name": "RuckusAP",
            "approved": true,
            "connected": false,
            "gateway_tags": [
                "RuckusAP",
                "30:87:D9:14:57:A0"
            ],
            "network_info": {
                "get_radio_channel": 24,
                "set_radio_tx_power": 6,
                "get_network_id": "0x1234",
                "set_network_id": "0x1234",
                "set_iot_coex": false,
                "get_radio_tx_power": 6,
                "network_mac": "90:FD:9F:FF:FE:7C:2D:0E",
                "set_network_type": "zigbee",
                "get_network_type": "zigbee",
                "set_radio_channel": 24,
                "get_iot_coex": false
            },
            "diagnostics_info": {
                "mqtt_qos": "2",
                "network_type": "zigbee",
                "ap_up_time": "0 days, 23:57:51",
                "gateway_up_time": "0 days, 0:14:37",
                "memory_usage": "4608 bytes",
                "interface_name": "/dev/ttyUSB0",
                "network_stack": "EZSP",
                "cpu_usage": "0.010000%",
                "network_stack_ver": "6.4.0.385"
            },
            "updated_on": "2018-11-21T09:30:51.613000Z",
            "ip_network_info": {
                "country_code": "WW",
                "dns": [
                    " 172.17.17.16"
                ],
                "ctl_host": "Cluster",
                "set_vlan_enable": 0,
                "netmask": "255.255.255.0",
                "gateway": "192.168.105.1",
                "apgroup_name": "default",
                "mac": "30:87:D9:14:57:A0",
                "get_vlan_enable": 0,
                "set_vlan_id": 1,
                "gateway_name": "RuckusAP",
                "zone_name": "Zone",
                "domain_id": "8b2081d5-9662-40d9-a3db-2a3cf4dde3f7",
                "domain_name": "Administration Domain",
                "ip": "192.168.105.14",
                "get_vlan_id": 1,
                "zone_id": "9e9f95ed-dcb0-4d2a-ad04-079a355d8821",
                "apgroup_id": "09381260-3065-4e67-9a76-91c2b90d029a"
            },
            "device_info": [],
            "created_on": "2018-11-21T09:13:49.525000Z"
        }
    ]
}

Query Gateways

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the detailed list of gateways added under the account. These gateways can either be added automatically to RIoT or manually from the Create Gateway API. All the gateways which are automatically added have their names like Auto Created . All the gateways which have communicated with RIoT will have extra details of the network and IoT network information.

Response Key Explanation

Key Type Explanation
gateway_tags Array Tags assigned to the gateway
gateway_name String Name given to the gateway
updated_on Timestamp The timestamp when the gateway was updated
created_on Timestamp The timestamp of when the gateway was created
connected Boolean The state whether the gateway is connected to RIoT
gateway_euid String The MAC address or the identifier of the gateway
ip_network_info Array Contains the information of the IP network
netmask String Netmask Address of the Access point
ip String IP Address of the Access point
mac String MAC Address of the Access point
dns Array Array of DNS servers of the Access point
gateway String Gateway Address of the Access point
network_info Array Contains information of the IoT Network
get_radio_tx_power Integer The radio TX power of the IoT Dongle
network_mac String The MAC address of the IoT Dongle
network_type String The type of IoT network either ble or zigbee
set_radio_channel Integer The radio channel of the IoT Dongle
network_id String The IoT radio network address
set_radio_tx_power Integer The radio TX power of the IoT Dongle
get_radio_channel Integer The radio channel of the IoT Dongle
diagnostics_info Array Contains the diagnostics information of the gateway
memory_usage String RAM usage of the gateway
mqtt_qos String MQTT QoS set for communication to the MQTT Broker
network_type String Type of IoT network initiated
network_stack String The name of the IoT network stack
network_stack_ver String The version of the IoT network stack
ap_up_time String Time lapsed from the AP bootup
interface_name String The interface through which the IoT network is initiated
cpu_usage String The percentage use of the CPU
gateway_up_time String Time lapsed from the IoT Gateway bootup

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Gateways not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway?limit=10&offset=0&connected=true&gateway_tags=auto created 0c:f4:d5:1e:3c:40&gateway_name=Auto Created 0C:F4:D5:1E:3C:40"
GET %7B%7Bhost%7D%7D/app/v1/gateway?limit=10&offset=0&connected=true&gateway_tags=auto created 0c:f4:d5:1e:3c:40&gateway_name=Auto Created 0C:F4:D5:1E:3C:40 HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200
allowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
content-length3172
content-typeapplication/json
dateMon, 04 Sep 2017 15:23:47 GMT
serverWSGIServer/0.2 CPython/3.5.2
x-frame-optionsSAMEORIGIN
[
    {
        "ip_network_info": {
            "netmask": "255.255.254.0",
            "ip": "172.19.150.57",
            "mac": "EC:8C:A2:33:B6:30",
            "dns": [
                " 172.19.0.5"
            ],
            "gateway": "172.19.150.1"
        },
        "gateway_tags": [
            "Auto Created EC:8C:A2:33:B6:30",
            "EC:8C:A2:33:B6:30"
        ],
        "gateway_name": "Auto Created EC:8C:A2:33:B6:30",
        "network_info": {
            "get_radio_tx_power": "NA",
            "network_mac": "00:00:00:0B:57:1B:4F:7D",
            "network_type": "ble",
            "set_radio_channel": 0,
            "network_id": "0xFFFF",
            "set_radio_tx_power": 0,
            "get_radio_channel": "NA"
        },
        "updated_on": "2017-09-04T06:45:14.518000Z",
        "created_on": "2017-09-01T06:12:21.339000Z",
        "diagnostics_info": {
            "memory_usage": "1652 bytes",
            "mqtt_qos": "0",
            "network_type": "BLE",
            "network_stack": "SILABS",
            "network_stack_ver": "2.4",
            "ap_up_time": "0 days, 0:02:31",
            "interface_name": "/dev/ttyUSB0",
            "cpu_usage": "4.070000%",
            "gateway_up_time": "0 days, 0:00:06"
        },
        "connected": true,
        "gateway_euid": "EC:8C:A2:33:B6:30"
    },
    {
        "ip_network_info": {
            "netmask": "255.255.254.0",
            "ip": "172.19.150.52",
            "mac": "D8:38:FC:25:BB:60",
            "dns": [
                " 172.19.0.5"
            ],
            "gateway": "172.19.150.1"
        },
        "gateway_tags": [
            "Auto Created D8:38:FC:25:BB:60",
            "D8:38:FC:25:BB:60"
        ],
        "gateway_name": "Auto Created D8:38:FC:25:BB:60",
        "network_info": {
            "get_radio_tx_power": 8,
            "network_mac": "00:22:A3:00:00:17:06:E3",
            "network_type": "zigbee",
            "set_radio_channel": 0,
            "network_id": "0xAE09",
            "set_radio_tx_power": 0,
            "get_radio_channel": 15
        },
        "updated_on": "2017-09-04T06:33:37.211000Z",
        "created_on": "2017-09-04T06:25:55.980000Z",
        "diagnostics_info": {
            "memory_usage": "1908 bytes",
            "mqtt_qos": "0",
            "network_type": "ZIGBEE",
            "network_stack": "EZSP",
            "network_stack_ver": "5.10.0-36",
            "ap_up_time": "3 days, 2:03:09",
            "interface_name": "/dev/ttyUSB0",
            "cpu_usage": "0.000000%",
            "gateway_up_time": "0 days, 0:00:07"
        },
        "connected": true,
        "gateway_euid": "D8:38:FC:25:BB:60"
    },
    {
        "gateway_tags": [
            "tag",
            "Gateway Test",
            "00:0D:6F:00:33:5E"
        ],
        "gateway_name": "Gateway Test",
        "updated_on": "Never",
        "created_on": "2017-09-04T09:22:00.294000Z",
        "connected": false,
        "gateway_euid": "00:0D:6F:00:33:5E"
    },
    {
        "gateway_tags": [
            "Gateway Test 1",
            "00:0D:6F:00:33:0E"
        ],
        "gateway_name": "Gateway Test 1",
        "updated_on": "Never",
        "created_on": "2017-09-04T09:22:19.633000Z",
        "connected": false,
        "gateway_euid": "00:0D:6F:00:33:0E"
    },
    {
        "gateway_tags": [
            "Gateway Test 3",
            "00:0D:6F:00:33:AE"
        ],
        "gateway_name": "Gateway Test 3",
        "updated_on": "Never",
        "created_on": "2017-09-04T09:22:49.426000Z",
        "connected": false,
        "gateway_euid": "00:0D:6F:00:33:AE"
    },
    {
        "gateway_tags": [
            "tag3",
            "Gateway Test 4",
            "00:0D:6F:00:33:6E"
        ],
        "gateway_name": "Gateway Test 4",
        "updated_on": "Never",
        "created_on": "2017-09-04T09:23:10.395000Z",
        "connected": false,
        "gateway_euid": "00:0D:6F:00:33:6E"
    },
    {
        "gateway_tags": [
            "tag1",
            "dummy gateway",
            "08:38:FC:25:BA:60"
        ],
        "gateway_name": "dummy gateway",
        "updated_on": "Never",
        "created_on": "2017-09-04T11:11:31.716000Z",
        "connected": false,
        "gateway_euid": "08:38:FC:25:BA:60"
    },
    {
        "gateway_tags": [
            "dummy gateway 2",
            "08:38:FC:25:BA:00"
        ],
        "gateway_name": "dummy gateway 2",
        "updated_on": "Never",
        "created_on": "2017-09-04T11:11:46.901000Z",
        "connected": false,
        "gateway_euid": "08:38:FC:25:BA:00"
    },
    {
        "gateway_tags": [
            "tag4",
            "dummy gateway 2",
            "08:38:FC:25:B0:00"
        ],
        "gateway_name": "dummy gateway 2",
        "updated_on": "Never",
        "created_on": "2017-09-04T11:11:57.646000Z",
        "connected": false,
        "gateway_euid": "08:38:FC:25:B0:00"
    }
]
Status401
allowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
content-length63
content-typeapplication/json
dateMon, 04 Sep 2017 15:44:19 GMT
serverWSGIServer/0.2 CPython/3.5.2
www-authenticatetoken
x-frame-optionsSAMEORIGIN
{
    "detail": "Access Token Expired. Please refresh Access token."
}

Search Gateways

This endpoint is a token-auth protected endpoint.

This endpoint is used to search the detailed list of gateways added under the account. These gateways can either be added automatically to RIoT or manually from the Create Gateway API. All the gateways which are automatically added have their names like Auto Created . All the gateways which have communicated with RIoT will have extra details of the network and IoT network information.

Response Key Explanation

Key Type Explanation
gateway_tags Array Tags assigned to the gateway
gateway_name String Name given to the gateway
updated_on Timestamp The timestamp when the gateway was updated
created_on Timestamp The timestamp of when the gateway was created
connected Boolean The state whether the gateway is connected to RIoT
gateway_euid String The MAC address or the identifier of the gateway
ip_network_info Array Contains the information of the IP network
netmask String Netmask Address of the Access point
ip String IP Address of the Access point
mac String MAC Address of the Access point
dns Array Array of DNS servers of the Access point
gateway String Gateway Address of the Access point
network_info Array Contains information of the IoT Network
get_radio_tx_power Integer The radio TX power of the IoT Dongle
network_mac String The MAC address of the IoT Dongle
network_type String The type of IoT network either ble or zigbee
set_radio_channel Integer The radio channel of the IoT Dongle
network_id String The IoT radio network address
set_radio_tx_power Integer The radio TX power of the IoT Dongle
get_radio_channel Integer The radio channel of the IoT Dongle
diagnostics_info Array Contains the diagnostics information of the gateway
memory_usage String RAM usage of the gateway
mqtt_qos String MQTT QoS set for communication to the MQTT Broker
network_type String Type of IoT network initiated
network_stack String The name of the IoT network stack
network_stack_ver String The version of the IoT network stack
ap_up_time String Time lapsed from the AP bootup
interface_name String The interface through which the IoT network is initiated
cpu_usage String The percentage use of the CPU
gateway_up_time String Time lapsed from the IoT Gateway bootup

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Gateways not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway/search?search_string=bl&limit=10"
GET %7B%7Bhost%7D%7D/app/v1/gateway/search?search_string=bl&limit=10 HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status401
allowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
content-length63
content-typeapplication/json
dateMon, 04 Sep 2017 15:44:19 GMT
serverWSGIServer/0.2 CPython/3.5.2
www-authenticatetoken
x-frame-optionsSAMEORIGIN
{
    "meta": {
        "query": "{'search_string': ['bl']}",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    },
    "data": [
        {
            "gateway_euid": "30:87:D9:14:6A:00",
            "gateway_name": "cable-ble",
            "approved": true,
            "connected": false,
            "gateway_tags": [
                "kontakt:2aeg9",
                "cable-ble",
                "30:87:D9:14:6A:00"
            ],
            "network_info": {
                "get_radio_channel": "NA",
                "get_network_type": "ble",
                "set_radio_channel": "NA",
                "set_network_id": "0xFFFF",
                "set_iot_coex": true,
                "network_mac": "90:FD:9F:FF:FE:7C:32:B3",
                "get_network_id": "0xFFFF",
                "set_network_type": "ble",
                "get_radio_tx_power": 8,
                "set_radio_tx_power": 8,
                "get_iot_coex": true
            },
            "diagnostics_info": {
                "mqtt_qos": "2",
                "network_type": "ble",
                "ap_up_time": "1 days, 21:39:12",
                "gateway_up_time": "0 days, 2:38:24",
                "memory_usage": "5832 bytes",
                "interface_name": "/dev/ttyUSB0",
                "network_stack": "SILABS",
                "cpu_usage": "0.670000%",
                "network_stack_ver": "2.10.0.385"
            },
            "updated_on": "2018-11-14T09:09:56.999000Z",
            "ip_network_info": {
                "country_code": "WW",
                "ctl_host": "clust",
                "domain_name": "H510",
                "zone_id": "2757b80b-5ffa-44f9-9467-ab53fee882e8",
                "domain_id": "6dc2a7f1-41c3-4494-b787-bbc8ac438cef",
                "gateway": "10.22.139.254",
                "apgroup_name": "H510-group",
                "mac": "30:87:D9:14:6A:00",
                "get_vlan_enable": 0,
                "set_vlan_id": 1,
                "gateway_name": "cable-ble",
                "zone_name": "H510-desk-zone",
                "netmask": "255.255.252.0",
                "set_vlan_enable": 0,
                "ip": "10.22.136.253",
                "get_vlan_id": 1,
                "apgroup_id": "0e92343b-89fb-418e-ab22-7884acb4271f",
                "dns": [
                    " 10.10.10.10"
                ]
            },
            "device_info": [],
            "created_on": "2018-11-12T11:40:39.341000Z"
        }
    ]
}

Single Gateway

This endpoint is a token-auth protected endpoint.

This endpoint is used to get the details of a gateway requested under the account. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}

These gateway can either be added automatically to RIoT or manually from the Create Gateway API. The gateway which are automatically added have their names like Auto Created . If the gateways has communicated with RIoT, it will have extra details of the network and IoT network information.

Response Key Explanation

Key Type Explanation
gateway_tags Array Tags assigned to the gateway
gateway_name String Name given to the gateway
updated_on Timestamp The timestamp when the gateway was updated
created_on Timestamp The timestamp of when the gateway was created
connected Boolean The state whether the gateway is connected to RIoT
gateway_euid String The MAC address or the identifier of the gateway
ip_network_info Array Contains the information of the IP network
netmask String Netmask Address of the Access point
ip String IP Address of the Access point
mac String MAC Address of the Access point
dns Array Array of DNS servers of the Access point
gateway String Gateway Address of the Access point
network_info Array Contains information of the IoT Network
get_radio_tx_power Integer The radio TX power of the IoT Dongle
network_mac String The MAC address of the IoT Dongle
network_type String The type of IoT network either ble or zigbee
set_radio_channel Integer The radio channel of the IoT Dongle
network_id String The IoT radio network address
set_radio_tx_power Integer The radio TX power of the IoT Dongle
get_radio_channel Integer The radio channel of the IoT Dongle
diagnostics_info Array Contains the diagnostics information of the gateway
memory_usage String RAM usage of the gateway
mqtt_qos String MQTT QoS set for communication to the MQTT Broker
network_type String Type of IoT network initiated
network_stack String The name of the IoT network stack
network_stack_ver String The version of the IoT network stack
ap_up_time String Time lapsed from the AP bootup
interface_name String The interface through which the IoT network is initiated
cpu_usage String The percentage use of the CPU
gateway_up_time String Time lapsed from the IoT Gateway bootup

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 Gateway not found in RIoT
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway/30:87:D9:14:6A:00"
GET %7B%7Bhost%7D%7D/app/v1/gateway/30:87:D9:14:6A:00 HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status404 Not Found
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionclose
Content-Length121
Content-Typeapplication/json
DateWed, 26 Jul 2017 11:48:32 GMT
Servergunicorn/19.6.0
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "code": 404,
    "http_code": 404,
    "developer_message": null,
    "message": "Gateway D8:38:FC:25:BB:60 not found",
    "http_message": null
}
Status200
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionkeep-alive
Content-Length1337
Content-Typeapplication/json
DateWed, 21 Nov 2018 11:04:36 GMT
Servernginx
Strict-Transport-Securitymax-age=63072000
X-Frame-OptionsSAMEORIGIN
X-Frame-OptionsSAMEORIGIN
{
    "gateway_euid": "30:87:D9:14:6A:00",
    "gateway_name": "cable-ble",
    "approved": true,
    "connected": false,
    "gateway_tags": [
        "kontakt:2aeg9",
        "cable-ble",
        "30:87:D9:14:6A:00"
    ],
    "network_info": {
        "get_radio_channel": "NA",
        "get_network_type": "ble",
        "set_radio_channel": "NA",
        "set_network_id": "0xFFFF",
        "set_iot_coex": true,
        "network_mac": "90:FD:9F:FF:FE:7C:32:B3",
        "get_network_id": "0xFFFF",
        "set_network_type": "ble",
        "get_radio_tx_power": 8,
        "set_radio_tx_power": 8,
        "get_iot_coex": true
    },
    "diagnostics_info": {
        "mqtt_qos": "2",
        "network_type": "ble",
        "ap_up_time": "1 days, 21:39:12",
        "gateway_up_time": "0 days, 2:38:24",
        "memory_usage": "5832 bytes",
        "interface_name": "/dev/ttyUSB0",
        "network_stack": "SILABS",
        "cpu_usage": "0.670000%",
        "network_stack_ver": "2.10.0.385"
    },
    "updated_on": "2018-11-14T09:09:56.999000Z",
    "ip_network_info": {
        "country_code": "WW",
        "ctl_host": "clust",
        "domain_name": "H510",
        "zone_id": "2757b80b-5ffa-44f9-9467-ab53fee882e8",
        "domain_id": "6dc2a7f1-41c3-4494-b787-bbc8ac438cef",
        "gateway": "10.22.139.254",
        "apgroup_name": "H510-group",
        "mac": "30:87:D9:14:6A:00",
        "get_vlan_enable": 0,
        "set_vlan_id": 1,
        "gateway_name": "cable-ble",
        "zone_name": "H510-desk-zone",
        "netmask": "255.255.252.0",
        "set_vlan_enable": 0,
        "ip": "10.22.136.253",
        "get_vlan_id": 1,
        "apgroup_id": "0e92343b-89fb-418e-ab22-7884acb4271f",
        "dns": [
            " 10.10.10.10"
        ]
    },
    "device_info": [],
    "created_on": "2018-11-12T11:40:39.341000Z"
}

Approve Gateway

curl -X PUT -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '{
	"iot_approved":true
}' "{{host}}/app/v1/gateway/EC:8C:A2:37:03:A0/management/IOT_APPROVED"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/EC:8C:A2:37:03:A0/management/IOT_APPROVED HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

{
	"iot_approved":true
}

Vlan Enable

curl -X PUT -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '{
	"vlan_enable":	true,
"vlan_id":	4
}' "{{host}}/app/v1/gateway/0C:F4:D5:1E:3C:40/management/VLAN_ENABLE"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/0C:F4:D5:1E:3C:40/management/VLAN_ENABLE HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

{
	"vlan_enable":	true,
"vlan_id":	4
}

Vlan Disable

curl -X PUT -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '{
	"vlan_enable":	false,
"vlan_id":	0
}' "{{host}}/app/v1/gateway/0C:F4:D5:1E:3C:40/management/VLAN_ENABLE"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/0C:F4:D5:1E:3C:40/management/VLAN_ENABLE HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

{
	"vlan_enable":	false,
"vlan_id":	0
}

Unapprove Gateway

curl -X PUT -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '{
	"iot_approved":false
}' "{{host}}//app/v1/gateway/EC:8C:A2:37:03:A0/management/IOT_APPROVED"
PUT %7B%7Bhost%7D%7D//app/v1/gateway/EC:8C:A2:37:03:A0/management/IOT_APPROVED HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

{
	"iot_approved":false
}

Create Gateway

This endpoint is a token-auth protected endpoint.

This endpoint is used to manually add a single gateway by providing required details for the gateway.

Request Key Explanation

Key Type Explanation
gateway_tags Array (optional) Tags to be assigned to the gateway
gateway_name String Name given to the gateway
gateway_euid String The MAC address or the identifier of the gateway

The gateway_name field can accept only a-zA-Z0-9 .:_- characters. By default, the gateway_name and the gateway_euid of the gateway will be added to the tags.

The endpoint accepts only gateway_tags, gateway_name and gateway_euid. If any other fields are passed the endpoint will return error 400 Bad Request.

Response Key Explanation

Key Type Explanation
gateway_tags Array Tags assigned to the gateway
gateway_name String Name given to the gateway
updated_on Timestamp The timestamp when the gateway was updated
created_on Timestamp The timestamp of when the gateway was created
connected Boolean The state whether the gateway is connected to RIoT
gateway_euid String The MAC address or the identifier of the gateway

After the gateway communicates with it’s settings to RIoT, the details of the gateway will be added as seen in the All Gateways API.

Expected status codes

Status Code Explanation
201 Gateway created successfully
400 Error in API body or validation failed for data provided
401 Invalid token
409 Gateway already exists with same gateway_euid
500 Critical Server Error
curl -X POST -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "gateway_tags": ["Gateway BDC", "D8:38:FC:25:BB:67", "D8:38:FC:25:BB:67"],
  "gateway_euid": "D8:38:FC:25:BB:67"
}' "{{host}}/app/v1/gateway/"
POST %7B%7Bhost%7D%7D/app/v1/gateway/ HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "gateway_tags": ["Gateway BDC", "D8:38:FC:25:BB:67", "D8:38:FC:25:BB:67"],
  "gateway_euid": "D8:38:FC:25:BB:67"
}
Status201 Created
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length177
Content-Typeapplication/json
DateTue, 25 Jul 2017 13:14:51 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "gateway_name": "Gateway BDC",
    "gateway_tags": [
        "Gateway BDC"
    ],
    "updated_on": "Never",
    "gateway_euid": "D8:38:FC:25:BB:60",
    "created_on": "2017-07-25T13:14:51.343738",
    "connected": false
}
Status409 Conflict
Access-Control-Allow-Origin*
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Length118
Content-Typeapplication/json
DateTue, 25 Jul 2017 13:15:26 GMT
ServerWSGIServer/0.2 CPython/3.5.2
VaryCookie
X-Frame-OptionsSAMEORIGIN
{
    "developer_message": null,
    "code": 409,
    "http_code": 409,
    "message": "Gateway D8:38:FC:25:BB:60 exists",
    "http_message": null
}

Update Gateway

This endpoint is a token-auth protected endpoint.

This endpoint is used to edit a single gateway by providing required details for the gateway. The URL should contain the gateways’ euid

{{host}}app/v1/gateway/{gateway_euid}

Once the gateway is added the gateway_euid field cannot be modified. If any wrong gateway_euid is added then delete the particular gateway and add it again.

Request Key Explanation

Key Type Explanation
gateway_tags Array (optional) Tags to be assigned to the gateway
gateway_name String (optional) Name given to the gateway

The gateway_name field can accept only a-zA-Z0-9 .:_- characters. Only the field which need to be edited can be passed to the endpoint. There are no mandatory fields.

If gateway tags are not mentioned in the body it will retain the previous tags else it will overwrite the previous tags.

The endpoint accepts only gateway_tags and gateway_name. If any other fields are passed the endpoint will return error 400 Bad Request.

Response Key Explanation

Key Type Explanation
gateway_tags Array Tags assigned to the gateway
gateway_name String Name given to the gateway
updated_on Timestamp The timestamp when the gateway was updated
created_on Timestamp The timestamp of when the gateway was created
connected Boolean The state whether the gateway is connected to RIoT
gateway_euid String The MAC address or the identifier of the gateway

After the gateway communicates with it’s settings to RIoT, the details of the gateway will be added as seen in the All Gateways API.

Expected status codes

Status Code Explanation
200 Gateway edited successfully
400 Error in API body or validation failed for data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Token {{auth_token}}" -d '{
  "gateway_tags": ["Some Gateway", "Edited Gateway"]
}' "{{host}}/app/v1/gateway/D8:38:FC:25:BB:60"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:BB:60 HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Authorization: Token {{auth_token}}

{
  "gateway_tags": ["Some Gateway", "Edited Gateway"]
}
Status200 OK

Delete Gateway

This endpoint is a token-auth protected endpoint.

This endpoint is used to delete a single gateway by providing required details for the gateway. The URL should contain the gateways’ euid

{{host}}app/v1/gateway/{gateway_euid}

Once the gateway is deleted all the devices mapped under the gateway will also be deleted. If the devices need to be retained map the devices to a different gateway and then delete the gateway.

Gateways and devices once deleted cannot be retrieved.

The endpoint accepts nothing in the API body.

Expected status codes

Status Code Explanation
204 Gateway deleted successfully
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X DELETE -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" "{{host}}/app/v1/gateway/D8:38:FC:25:BB:60"
DELETE %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:BB:60 HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

Patch Add Gateway

curl -X PATCH -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '[
{
 "Tags": "Gateway BDC| D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:67"
},
{
 "Tags": "Gateway BDC|D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:68"
}
]' "{{host}}/app/v1/gateway?op=add"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway?op=add HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

[
{
 "Tags": "Gateway BDC| D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:67"
},
{
 "Tags": "Gateway BDC|D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:68"
}
]

Patch Update Gateway

curl -X PATCH -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '[
{
 "Tags": "Gateway BDC| D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:67"
},
{
 "Tags": "Gateway BDC|D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:68"
}
]' "{{host}}/app/v1/gateway?op=update"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway?op=update HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: application/json

[
{
 "Tags": "Gateway BDC| D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:67"
},
{
 "Tags": "Gateway BDC|D8:38:FC:25:BB:67",
 "IoT AP MAC": "D8:38:FC:25:E7:68"
}
]

Patch Delete Gateway

curl -X PATCH -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Token {{auth_token}}" -F "filename=" "{{host}}/app/v1/gateway?op=delete"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway?op=delete HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="filename"


----WebKitFormBoundary7MA4YWxkTrZu0gW

Gateway Management

This section describes the set of gateway APIs which are used to interact with the Ruckus RIoT gateway.

Gateway Operations

These are the set of APIs which can change the operational mode of the gateway. These APIs are more of managing the gateway like IoT restart, changing mode and others as explained below.

Gateway IoT Restart

This endpoint is a token-auth protected endpoint.

This endpoint is used to restart the IoT service inside the AP. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/IOT_RESTART

Once the API is called the gateway connected state as false. Once the gateway IoT service boots up it will publish it’s settings and the connected state will become true. Until the connected becomes true no operations can be performed on the gateway or devices.

The endpoint accepts an empty body. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Gateway IoT Restart queued successfully
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gateway/D8:38:FC:25:BB:60/management/IOT_RESTART"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:BB:60/management/IOT_RESTART HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

Set Gateway Zigbee Channel

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the zigbee channel of the IoT network in the AP. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/ZIGBEE_CHANNEL

Once the API is called the zigbee channel in the gateway is set and the IoT process will reboot. If the gateway is running in the ble mode the values or the zigbee channel will be set and the AP will reboot but the ble operations will not be affected.

Once the API is called the gateway connected state as false. Once the gateway IoT service boots up it will publish it’s settings and the connected state will become true. Until the connected becomes true no operations can be performed on the gateway or devices.

The endpoint accepts only zigbee_channel. If any other fields are passed the endpoint will return error 400 Bad Request.

Request Key Explanation

Key Type Explanation
zigbee_channel Integer The channel in which the zigbee dongle should start the network

The zigbee channel will accept values between 11-25 as integer.

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "zigbee_channel": 11
}' "{{host}}/app/v1/gateway/D8:38:FC:25:BB:60/management/ZIGBEE_CHANNEL"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:BB:60/management/ZIGBEE_CHANNEL HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "zigbee_channel": 11
}

Set Gateway Tx Power

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the zigbee dongle Tx power for the network when the IoT network starts. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/ZIGBEE_TX_POWER

Once the API is called the zigbee Tx Power in the gateway is set and the IoT process will reboot. If the gateway is running in the ble mode the values or the zigbee channel will be set and the AP will reboot but the ble operations will not be affected.

Tx Power is the power in which the dongle should operate in. The higher the power the better the transmission of data between the gateway and devices.

Once the API is called the gateway connected state as false. Once the gateway IoT service boots up it will publish it’s settings and the connected state will become true. Until the connected becomes true no operations can be performed on the gateway or devices.

Request Key Explanation

Key Type Explanation
zigbee_tx_power Integer The Tx power in which the zigbee dongle should start the network

The zigbee_tx_power will accept Integer values between 0-20.

The endpoint accepts only zigbee_tx_power. If any other fields are passed the endpoint will return error 400 Bad Request.

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
  "zigbee_tx_power": 0
}' "{{host}}/app/v1/gateway/D8:38:FC:25:BB:60/management/ZIGBEE_TX_POWER"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:BB:60/management/ZIGBEE_TX_POWER HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
  "zigbee_tx_power": 0
}

Set Gateway IOTG MODE

This endpoint is a token-auth protected endpoint.

This endpoint is used to set the IOT MODE of the IoT network in the AP. The URL should contain the gateways’ euid.

{{host}}app/v1/gateway/{gateway_euid}/IOT_MODE

Once the API is called the iot mode in the gateway is set and the IoT process will reboot. Once the API is called the gateway connected state as false. Once the gateway IoT service boots up it will publish it’s settings and the connected state will become true. Until the connected becomes true no operations can be performed on the gateway or devices.

The endpoint accepts only iot_mode. If any other fields are passed the endpoint will return error 400 Bad Request.

Request Key Explanation

Key Type Explanation
iot_mode string The mode in which the zigbee dongle should start the network

The iot_mode will accept values between zigbee/ble/assa-abloy.

Expected status codes

Status Code Explanation
200 Gateway command queued successfully
400 Error in the data provided
404 Gateway not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
	"iot_mode": "zigbee_aa"
}' "{{host}}/app/v1/gateway/D8:38:FC:25:E7:F1/management/IOT_MODE"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:E7:F1/management/IOT_MODE HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

{
	"iot_mode": "zigbee_aa"
}

Multiple Set Gateway IOT MODE

curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
  {
    "gateway_euid": "D8:38:FC:25:E7:F1",
    "iot_mode": "zIgbee"
  },
  {
    "gateway_euid": "*",
    "iot_mode": "zIgbee_AA"
  }
]' "{{host}}/app/v1/gateway/management/IOT_MODE"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/IOT_MODE HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

[
  {
    "gateway_euid": "D8:38:FC:25:E7:F1",
    "iot_mode": "zIgbee"
  },
  {
    "gateway_euid": "*",
    "iot_mode": "zIgbee_AA"
  }
]

Multiple Gateway IoT Restart

curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
  {
    "gateway_euid": "D8:38:FC:25:BB:60"
  }
]' "{{host}}/app/v1/gateway/management/IOT_RESTART"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/IOT_RESTART HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

[
  {
    "gateway_euid": "D8:38:FC:25:BB:60"
  }
]

Multiple Set Gateway Tx Power

curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
  {
    "gateway_euid": "*",
    "zigbee_tx_power": 4
  },
  {
    "gateway_euid": "00:0D:6F:00:05:24:20:CE",
    "zigbee_tx_power": 5
  }
]' "{{host}}/app/v1/gateway/management/ZIGBEE_TX_POWER"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/ZIGBEE_TX_POWER HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

[
  {
    "gateway_euid": "*",
    "zigbee_tx_power": 4
  },
  {
    "gateway_euid": "00:0D:6F:00:05:24:20:CE",
    "zigbee_tx_power": 5
  }
]

Multiple Set Gateway Zigbee Channel

curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
  {
    "gateway_euid": "*",
    "zigbee_channel": 13
  },
  {
    "gateway_euid": "00:0D:6F:00:05:24:20:CE",
    "zigbee_channel": 14
  }
]' "{{host}}/app/v1/gateway/management/ZIGBEE_CHANNEL"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/ZIGBEE_CHANNEL HTTP/1.1
Host: 
Content-Type: application/json
Authorization: Token {{auth_token}}

[
  {
    "gateway_euid": "*",
    "zigbee_channel": 13
  },
  {
    "gateway_euid": "00:0D:6F:00:05:24:20:CE",
    "zigbee_channel": 14
  }
]

RIoT OPS

Get service details

curl -X GET -H "Authorization: Token {{auth_token}}" "https://{{url}}/service/v1/service-details"
failed to parse url
parse https://{{url}}/service/v1/service-details: invalid character "{" in host name

Init request

curl -X POST -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{"modules_list":["mongo_db","mqtt_broker","mqtt_listner","celery","auth_api","rabbitmq","mongo_defaults","dm_api","ipv4_mode_radio","long_scan"],"configurations": {"hostname": "vriot","dns": "","timezone": "America/Los_Angeles","ipv4_mode_radio": "0","ip-address": "","dns2": "","gateway":"","subnet-mask": "","visionline-port": "443","visionline-username": "","visionline-password": "","visionline-ip": "","ibm-api-key": "","ibm-api-token": "","ibm-org-id": "","ibm-gateway-id": "","ibm-gateway-type": "","ibm-gateway-token": "","opwd": "","npwd": "","rtpwd": "","systemtime": ["1", null],"fqdn": "vriot.platform.com","ssl-enabled": true}}' "https://{{url}}/service/init"
failed to parse url
parse https://{{url}}/service/init: invalid character "{" in host name

Reset VRIoT

curl -X POST -H "Authorization: Token {{auth_token}}" "https://{{url}}/reset"
failed to parse url
parse https://{{url}}/reset: invalid character "{" in host name

Set datetime and NTP

curl -X PATCH -H "Content-Type: application/json" -d '{
	"configurations":{
		"hostname":"vriot",
		"systemtime":["0","06/21/2018 09:00:10"]
	}
}' "https://{{url}}/service/init"
failed to parse url
parse https://{{url}}/service/init: invalid character "{" in host name

SDK Management

SDK Connector

This endpoint is a token-auth protected endpoint.

{{host}}/app/v1/sdk/{{vendor_id}}

This endpoint is used to get the details of the SDK for a particular vendor specified using the vendor ID.

Response Key Explanation

Key Type Explanation
vendor_id String Vendor ID of a particular vendor
vendor_name String Vendor name of a particular vendor
package_name String Name of the SDK package
sub_callback String Name of the subscribe callback
settings Dictionary Settings to be used in the vendor SDK package

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Invalid token
404 SDK connector not found for the specified vendor ID
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/sdk/{{vendor_id}}"
GET %7B%7Bhost%7D%7D/app/v1/sdk/%7B%7Bvendor_id%7D%7D HTTP/1.1
Host: 
Authorization: Token {{auth_token}}

Create SDK Connector

This endpoint is a token-auth protected endpoint.

This endpoint is used to manually add a SDK connector for a particular vendor by providing the required details.

Request Key Explanation

Key Type Explanation
vendor_id String ID of a vendor
vendor_name String Name of the vendor
package_name String Name of the vendor’s integration package
settings Dictionary {optional) these are settings that will be used in the vendor’s integration package

The endpoint accepts only vendor_id, vendor_name, package_name and settings. If any other fields are passed, the endpoint will return error 400 Bad Request.

Response Key Explanation

Key Type Explanation
vendor_id String ID of the vendor
vendor_name String Name of the vendor
package_name String Name of the vendor SDK package
sub_callback String Name of the subscribe callback in the vendor SDK package
settings Dictionary The settings / constants which are required for the vendor SDK package
updated_on Timestamp The timestamp when the SDK entry for a vendor was updated
created_on Timestamp The timestamp of when the SDK entry for a vendor was created

Expected status codes

Status Code Explanation
201 SDK for a particular vendor created successfully
400 Error in API body or validation failed for data provided
401 Invalid token
409 SDK for the vendor already exists with same vendor_id
500 Critical Server Error
curl -X POST -H "Authorization: Token {{auth_token}}" -d '{
    "vendor_name": "new_vendor",
    "vendor_id": "0xF1F5",
    "package_name": "new_package",
    "settings": {
		
	}
}' "{{host}}/app/v1/sdk/"
POST %7B%7Bhost%7D%7D/app/v1/sdk/ HTTP/1.1
Host: 
Authorization: Token {{auth_token}}

{
    "vendor_name": "new_vendor",
    "vendor_id": "0xF1F5",
    "package_name": "new_package",
    "settings": {
		
	}
}

Update SDK Connector

This endpoint is a token-auth protected endpoint.

{{host}}/app/v1/sdk/{{vendor_id}}

This endpoint is used to edit the SDK connector entry for a particular vendor by specifying the vendor ID.

Once the entry for the SDK connector is added, the vendor_id field cannot be modified. If any wrong vendor_id is added, then delete the particular SDK connector for the vendor and add it again.

Request Key Explanation

Key Type Explanation
settings Dictionary Settings to be used in the vendor integration package

The endpoint accepts only settings. If any other fields are passed the endpoint will return error 400 Bad Request.

Response Key Explanation

Key Type Explanation
vendor_id String ID of the vendor
vendor_name String Name of the vendor
package_name String Name of the vendor SDK package
sub_callback String Name of the subscribe callback in the vendor SDK package
settings Dictionary The settings / constants which are required for the vendor SDK package

Expected status codes

Status Code Explanation
200 SDK connector details for a particular vendor successfully updated
400 Error in API body or validation failed for data provided
404 SDK connector for a particular vendor not found
401 Invalid token
500 Critical Server Error
curl -X PUT -H "Authorization: Token {{auth_token}}" -d '{
	"settings": {
	}
}' "{{host}}/app/v1/sdk/{{vendor_id}}"
PUT %7B%7Bhost%7D%7D/app/v1/sdk/%7B%7Bvendor_id%7D%7D HTTP/1.1
Host: 
Authorization: Token {{auth_token}}

{
	"settings": {
	}
}

Delete SDK Connector

This endpoint is a token-auth protected endpoint.

{{host}}/app/v1/sdk/{{vendor_id}}

This endpoint is used to delete the SDK connector details for a particular vendor by specifying the vendor id.

SDK connector details for a particular vendor once deleted cannot be retrieved.

The endpoint accepts nothing in the API body.

Expected status codes

Status Code Explanation
204 SDK connector for the vendor ID deleted successfully
400 Validation failed for data provided
404 SDK connector for the vendor ID not found
401 Invalid token
500 Critical Server Error
curl -X DELETE -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/sdk/{{vendor_id}}"
DELETE %7B%7Bhost%7D%7D/app/v1/sdk/%7B%7Bvendor_id%7D%7D HTTP/1.1
Host: 
Authorization: Token {{auth_token}}

SmartZone

Get Smart Zone List

curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/smartzones"
GET %7B%7Bhost%7D%7D/app/v1/smartzones HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status200
{
    "info": {
        "smart_zones_count": 2
    },
    "data": {
        "orphan_gws": {
            "gw_count": 2
        },
        "smart_zones": [
            {
                "domains": [
                    {
                        "gw_count": 4,
                        "domain_name": "Admin Domain",
                        "zones": [
                            {
                                "gw_count": 2,
                                "zone_name": "Zone-GP-2",
                                "groups": [
                                    {
                                        "group_id": "a1827c74-292b-48ec-9bae-2ac94519adba",
                                        "gw_count": 2,
                                        "group_name": "default"
                                    }
                                ],
                                "zone_id": "92a372d3-ce0f-4980-8c83-ae98d7afe410"
                            },
                            {
                                "gw_count": 2,
                                "zone_name": "Zone-GP-1",
                                "groups": [
                                    {
                                        "group_id": "cc0c2bd2-e984-437c-aaba-b985666c442a",
                                        "gw_count": 1,
                                        "group_name": "default"
                                    },
                                    {
                                        "group_id": "92af3675-22b6-4b0f-817a-e58180c57c1d",
                                        "gw_count": 1,
                                        "group_name": "Co-Ex"
                                    }
                                ],
                                "zone_id": "3b6dae72-bdd1-4f9a-9073-c7bbece6c9bd"
                            }
                        ],
                        "domain_id": "8b2081d5-9662-40d9-a3db-2a3cf4dde3f7"
                    }
                ],
                "smart_zone_ip": "Default-cluster"
            },
            {
                "domains": [
                    {
                        "gw_count": 1,
                        "domain_name": "domain0",
                        "zones": [
                            {
                                "gw_count": 1,
                                "zone_name": "zone-1",
                                "groups": [
                                    {
                                        "group_id": "639ada78-5598-4a4c-8a09-a5947e144ef6",
                                        "gw_count": 1,
                                        "group_name": "extended-cover-group"
                                    }
                                ],
                                "zone_id": "918a5324-8f2f-44f7-9296-9e7c914e953a"
                            }
                        ],
                        "domain_id": "261fe8aa-0694-4ac6-a58c-105cc43acdaf"
                    },
                    {
                        "gw_count": 2,
                        "domain_name": "domain1",
                        "zones": [
                            {
                                "gw_count": 2,
                                "zone_name": "zone-2",
                                "groups": [
                                    {
                                        "group_id": "e587f12d-9049-4b9d-b4ab-565bdb6669ce",
                                        "gw_count": 1,
                                        "group_name": "extended-cable-group"
                                    },
                                    {
                                        "group_id": "607d3877-03bc-4434-a173-22e3b643aa35",
                                        "gw_count": 1,
                                        "group_name": "default"
                                    }
                                ],
                                "zone_id": "0afdd863-5405-4ea4-9142-f8aa41ec9850"
                            }
                        ],
                        "domain_id": "6899fe3b-5bb3-4053-be45-1d4184a178e9"
                    }
                ],
                "smart_zone_ip": "Cluster"
            }
        ]
    }
}

Statistics

These are the set of APIs which will give the statistics of the RIoT controller.

All the APIs in this section use token-auth for authentication.

Controller Statistics

This endpoint is a token-auth protected endpoint.

The controller statistics API gives the statistics of the RIoT controller

Response Key Explanation

Key Explanation
timestamp Timestamp of the RIoT controller

The new access_token should be saved and replaced with the previous access_token.

Expected status codes

Status Code Explanation
200 Request is processed successfully
401 Token invalid or expired
500 Critical Server Error
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/controller/stats"
GET %7B%7Bhost%7D%7D/app/v1/controller/stats HTTP/1.1
Host: 
Authorization: Token {{auth_token}}
Status401
allowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
content-length63
content-typeapplication/json
dateMon, 04 Sep 2017 12:45:50 GMT
serverWSGIServer/0.2 CPython/3.5.2
www-authenticatetoken
x-frame-optionsSAMEORIGIN
{
    "detail": "Access Token Expired. Please refresh Access token."
}
Status200
AllowGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Connectionkeep-alive
Content-Length65
Content-Typeapplication/json
DateWed, 21 Nov 2018 10:45:35 GMT
Servernginx
Strict-Transport-Securitymax-age=63072000
X-Frame-OptionsSAMEORIGIN
X-Frame-OptionsSAMEORIGIN
{
    "controller_version": "1.2.0.0.12",
    "datetime": "2018-11-21 10:45"
}