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.
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.
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 |
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=
Status | 401 Unauthorized |
---|---|
allow | GET, HEAD, OPTIONS |
connection | close |
content-length | 39 |
content-type | application/json |
date | Mon, 04 Sep 2017 05:39:26 GMT |
server | gunicorn/19.6.0 |
vary | Accept |
www-authenticate | Basic realm="api" |
x-frame-options | SAMEORIGIN |
|
Status | 200 OK |
---|---|
allow | GET, HEAD, OPTIONS |
connection | close |
content-length | 296 |
content-type | application/json |
date | Mon, 04 Sep 2017 05:39:00 GMT |
server | gunicorn/19.6.0 |
vary | Accept |
x-frame-options | SAMEORIGIN |
|
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 1 Week.
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=
Status | 200 OK |
---|---|
allow | GET, HEAD, OPTIONS |
content-length | 115 |
content-type | application/json |
date | Mon, 04 Sep 2017 10:07:35 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
vary | Accept |
x-frame-options | SAMEORIGIN |
|
Status | 401 Unauthorized |
---|---|
allow | GET, HEAD, OPTIONS |
content-length | 39 |
content-type | application/json |
date | Mon, 04 Sep 2017 10:12:11 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
vary | Accept |
www-authenticate | Basic realm="api" |
x-frame-options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to generate a refresh token. The validity of the refresh_token
is 60 days. 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 refresh token will be provided.
Response Key Explanation
Key | Explanation |
---|---|
refresh_token | Token for accessing endpoints protected by token authentication |
The new refresh_token
should be saved and replaced with the previous refresh_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
Status | 200 OK |
---|---|
allow | GET, HEAD, OPTIONS |
content-length | 58 |
content-type | application/json |
date | Mon, 04 Sep 2017 10:23:49 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
vary | Accept |
x-frame-options | SAMEORIGIN |
|
Status | 401 Unauthorized |
---|---|
allow | GET, HEAD, OPTIONS |
content-length | 27 |
content-type | application/json |
date | Mon, 04 Sep 2017 10:25:42 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
vary | Accept |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|
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
This endpoint is used to retrieve all the accounts which are added in the controller.
curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" "{{auth_host}}/v1/account/ars"
GET %7B%7Bauth_host%7D%7D/v1/account/ars HTTP/1.1
Host:
Authorization: Basic YWRtaW46YWRtaW4=
Status | 200 OK |
---|---|
Allow | GET, POST, HEAD, OPTIONS |
Connection | keep-alive |
Content-Length | 197 |
Content-Type | application/json |
Date | Wed, 21 Nov 2018 10:36:38 GMT |
Server | nginx |
Strict-Transport-Security | max-age=63072000 |
Vary | Accept |
X-Frame-Options | SAMEORIGIN |
X-Frame-Options | SAMEORIGIN |
|
This endpoint is used to retrieve the details of a specific username 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=
Status | 200 OK |
---|---|
Allow | GET, PATCH, DELETE, HEAD, OPTIONS |
Connection | keep-alive |
Content-Length | 195 |
Content-Type | application/json |
Date | Wed, 21 Nov 2018 10:37:37 GMT |
Server | nginx |
Strict-Transport-Security | max-age=63072000 |
Vary | Accept |
X-Frame-Options | SAMEORIGIN |
X-Frame-Options | SAMEORIGIN |
|
This endpoint is used to create an account 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
}
Status | 200 OK |
---|---|
Allow | GET, POST, HEAD, OPTIONS |
Connection | keep-alive |
Content-Length | 216 |
Content-Type | application/json |
Date | Wed, 21 Nov 2018 10:39:05 GMT |
Server | nginx |
Strict-Transport-Security | max-age=63072000 |
Vary | Accept |
X-Frame-Options | SAMEORIGIN |
X-Frame-Options | SAMEORIGIN |
|
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.
Gateway Management IOT_COEX
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '{
"iot_coex": true,
"network_mac":"90:FD:9F:FF:FE:7C:34:17"
}
' "{{host}}/app/v1/gateway/D8:38:FC:25:C4:C0/management/IOT_COEX"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:C4:C0/management/IOT_COEX HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
{
"iot_coex": true,
"network_mac":"90:FD:9F:FF:FE:7C:34:17"
}
Gateway Management IOT_RESTAR
curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
{
"gateway_euid": "8C:FE:74:21:F5:30"
}
]' "{{host}}/app/v1/gateway/management/IOT_RESTAR"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/IOT_RESTAR HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
[
{
"gateway_euid": "8C:FE:74:21:F5:30"
}
]
Gateway Management VLAN_ENABLE
curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
{
"gateway_euid": "B4:79:C8:3E:75:40",
"vlan_id": 3,
"vlan_enable": true,
"vlan_mode": "ONLINK"
}
]' "{{host}}/app/v1/gateway/management/VLAN_ENABLE"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/VLAN_ENABLE HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
[
{
"gateway_euid": "B4:79:C8:3E:75:40",
"vlan_id": 3,
"vlan_enable": true,
"vlan_mode": "ONLINK"
}
]
Gateway Management IOT_APPROVED
curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" -d '[
{
"gateway_euid": "B4:79:C8:3E:75:40",
"iot_approved": true
}
]' "{{host}}/app/v1/gateway/management/IOT_APPROVED"
PATCH %7B%7Bhost%7D%7D/app/v1/gateway/management/IOT_APPROVED HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
[
{
"gateway_euid": "B4:79:C8:3E:75:40",
"iot_approved": true
}
]
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.
This endpoint is a token-auth protected endpoint.
This endpoint is be used to get dashboard information.
{{host}}app/v1/dashboard/all
This endpoint is be used to get the devicesbyprovision, devicesbybatterylevel, provisioned, devicesbyprotocol, devicetype, gatewaymode, topaps,devicesbylastseen endpoint response in single dictionary.
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/all"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/all HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
Status | 200 OK |
---|---|
nginx | |
Wed, 14 Jul 2021 05:44:37 GMT | |
application/json | |
731 | |
keep-alive | |
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS | |
Origin | |
SAMEORIGIN | |
SAMEORIGIN | |
max-age=63072000 | |
|
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}}
This endpoint is a token-auth protected endpoint.
This endpoint is be used to get the count of provisioned gateways.
{{host}}app/v1/dashboard/provisioned
Response Key Explanation
Key | Type | Explanation |
---|---|---|
offlineApproved | int | has the value offline approved Aps |
onlineApproved | int | has the value online approved APs |
offlineUnapproved | int | has the value offline unapproved APs |
onlineUnapproved | int | has the value online unapproved APs |
total_gateway_count | int | has the value total count of the APs |
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/provisioned"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/provisioned HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
This endpoint is a token-auth protected endpoint.
This endpoint is be used to get the Battery level percentage of devices.
{{host}}app/v1/dashboard/devicesbybatterylevel
Response Key Explanation
Key | Type | Explanation |
---|---|---|
morethen90percentage | int | has the value of battery level is over 90% |
50percentage90percentage | int | has the value of battery level is lie between 50% to 90% |
30percentage50percentage | int | has the value of battery level is lie between 50% to 90% |
10percentage30percentage | int | has the value of battery level is less 10% |
NA | int | has the value of battery level is not updated |
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/devicesbybatterylevel"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/devicesbybatterylevel HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
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}}
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}}" "{{host}}/app/v1/dashboard/devicetype"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/devicetype HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
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/devicesbylastseen"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/devicesbylastseen HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
This endpoint is a token-auth protected endpoint.
This endpoint is be used to get the count of different types of gateway modes.
{{host}}app/v1/dashboard/gatewaymode
Response Key Explanation
Key | Type | Explanation |
---|---|---|
_id | int | has the value for the device_type |
count | int | quantifies the devices against this gatewaymode |
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/gatewaymode"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/gatewaymode HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
This endpoint is a token-auth protected endpoint.
This endpoint is be used to get the count of APs with most Devices.
{{host}}app/v1/dashboard/topaps
Response Key Explanation
Key | Type | Explanation |
---|---|---|
_id | int | has the value AP mac address |
gateway_name | string | has the value AP name |
count | int | quanhas the value of most devices connected to the AP |
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/topaps"
GET %7B%7Bhost%7D%7D/app/v1/dashboard/topaps HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
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.
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, or through scanning on gateways. 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_vdzg_info | Array | Information regarding group zone domain of the device |
custom | Array | |
network_mac | String | Mac address of the radio device is mapped |
lqi | Integer | link quality index |
wired_device | Boolean | Whether it is a wired device |
network_type | String | Type of network of device |
device_euid | String | Mac address of the device |
rssi | Integer | singal strength |
last_seen | Integer | epoch time when the device last communicated |
has_install_code | Integer | Whether this device is secured with a network key |
If the blacklisted
value is true
. Then there will be no communication between the device and 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
, SMART_PLUG
etc.
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"
GET %7B%7Bhost%7D%7D/app/v1/device?limit=10&offset=0 HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | keep-alive |
Content-Length | 17742 |
Content-Type | application/json |
Date | Wed, 21 Nov 2018 11:14:08 GMT |
Server | nginx |
Strict-Transport-Security | max-age=63072000 |
X-Frame-Options | SAMEORIGIN |
X-Frame-Options | SAMEORIGIN |
|
Status | 404 Not Found |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | close |
Content-Length | 103 |
Content-Type | application/json |
Date | Wed, 26 Jul 2017 11:47:27 GMT |
Server | gunicorn/19.6.0 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to get the information related to a device.
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_vdzg_info | Array | Information regarding group zone domain of the device |
custom | Array | |
network_mac | String | Mac address of the radio device is mapped |
lqi | Integer | link quality index |
wired_device | Boolean | Whether it is a wired device |
network_type | String | Type of network of device |
device_euid | String | Mac address of the device |
rssi | Integer | singal strength |
last_seen | Integer | epoch time when the device last communicated |
has_install_code | Integer | Whether this device is secured with a network key |
device_zcl_capability | Dictionary | Contains information of the Attributes supported by the device |
The device zcl capability is available only after the device has communicated with the RIoT controller. The contents of the device capability is as below:
{ “device_zcl_capability”: { “device_endpoint”: { “cluster_id”: { “parent_command”: “Parent command of this zigbee cluster”, “attributes”: [ { “reported_value_name”: “Undefined”, “attribute_name”: “IdentifyTime “, “reported_value”: { “value”: “Value received by device” }, “attribute_id”: “0x0000” } ], “commands”: { “command_id”: { “sub_command”: “ez-mode”, “params”: [ { “parameter 1”: “default value “ } ], “command_description”: “Description of this command” } } } } } }
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}}
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 1144 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 10:53:17 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 404 Not Found |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | close |
Content-Length | 103 |
Content-Type | application/json |
Date | Wed, 26 Jul 2017 11:47:27 GMT |
Server | gunicorn/19.6.0 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to get the devices based on the search string provided by the user.
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_vdzg_info | Array | Information regarding group zone domain of the device |
custom | Array | |
network_mac | String | Mac address of the radio device is mapped |
lqi | Integer | link quality index |
wired_device | Boolean | Whether it is a wired device |
network_type | String | Type of network of device |
device_euid | String | Mac address of the device |
rssi | Integer | singal strength |
last_seen | Integer | epoch time when the device last communicated |
has_install_code | Integer | Whether this device is secured with a network key |
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/search?search_string=bl&limit=10"
GET %7B%7Bhost%7D%7D/app/v1/device/search?search_string=bl&limit=10 HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Status | 404 Not Found |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | close |
Content-Length | 103 |
Content-Type | application/json |
Date | Wed, 26 Jul 2017 11:47:27 GMT |
Server | gunicorn/19.6.0 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 1144 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 10:53:17 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
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 device’s euid.
{{host}}app/v1/device/{device_euid}
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_vdzg_info | Array | Information regarding group zone domain of the device |
custom | Array | |
network_mac | String | Mac address of the radio device is mapped |
lqi | Integer | link quality index |
wired_device | Boolean | Whether it is a wired device |
network_type | String | Type of network of device |
device_euid | String | Mac address of the device |
rssi | Integer | singal strength |
last_seen | Integer | epoch time when the device last communicated |
has_install_code | Integer | Whether this device is secured with a network key |
device_zcl_capability | Dictionary | Contains information of the Attributes supported by the device |
The device zcl capability is available only after the device has communicated with the RIoT controller. The contents of the device capability is as below:
{ “device_zcl_capability”: { “device_endpoint”: { “cluster_id”: { “parent_command”: “Parent command of this zigbee cluster”, “attributes”: [ { “reported_value_name”: “Undefined”, “attribute_name”: “IdentifyTime “, “reported_value”: { “value”: “Value received by device” }, “attribute_id”: “0x0000” } ], “commands”: { “command_id”: { “sub_command”: “ez-mode”, “params”: [ { “parameter 1”: “default value “ } ], “command_description”: “Description of this command” } } } } } }
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/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}}
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 1144 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 10:53:17 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 404 Not Found |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 126 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 11:42:08 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
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 |
network_mac | String | (optional)The MAC address of the radio under which the device is mapped |
network_type | String | (optional)Network type of device |
blacklist | Boolean | (optional)Whether device is blacklisted |
install_code | String | (optional)Network key of this device |
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.network_mac
, blacklist
, install_code
and network_type
are optional fields.
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",
"install_code":"MTEgMDEgMDMgNTMgNTQgOTAgMDQgRDM=",
"gateway_euid":"D8:38:FC:25:BB:60",
"device_tags":["Sample Tag"],
"network_mac":"90:FD:9F:FF:FE:0C:89:36",
"network_type":"zigbee"
}' "{{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",
"install_code":"MTEgMDEgMDMgNTMgNTQgOTAgMDQgRDM=",
"gateway_euid":"D8:38:FC:25:BB:60",
"device_tags":["Sample Tag"],
"network_mac":"90:FD:9F:FF:FE:0C:89:36",
"network_type":"zigbee"
}
Status | 400 Bad Request |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 189 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:10:30 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 201 Created |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 239 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:09:46 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
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
}
Status | 404 Not Found |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 126 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:22:01 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 200 OK |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 236 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:12:28 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 404 Not Found |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 121 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:15:07 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
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
Status | 200 OK |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 0 |
Date | Tue, 25 Jul 2017 12:19:25 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
Status | 404 Not Found |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 126 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:20:10 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
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
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
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
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.
These are the set of APIs which communicate to the RIoT gateway for scan related operations. Using these APIs we can start and stop scanning for devices.
This endpoint is a token-auth protected endpoint.
This endpoint is used to get the list of devices scanned by the gateway during the device scan operation. The URL should contain the gateways’ euid.
{{host}}app/v1/gateway/scan
The API will return the list of devices scanned. The scan list will get refreshed every 4 minutes. The devices will be removed from the list once they are discovered after a duration of 12 hours. 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}}
Status | 200 OK |
---|---|
|
This endpoint is a token-auth protected endpoint.
This endpoint is used initiate the device scan operation for one or more gateways.
{{host}}app/v1/gateway/scan/start
The API will start the device scan operation for the specified gateway(s). Once the command is initiated, new devices which are not in RIoT will respond to the particular gateway.
Request Key Explanation
Key | Type | Explanation |
---|---|---|
gateway_euid | String | Mac address of the gateway |
value | String | On |
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"
}]
This endpoint is a token-auth protected endpoint.
This endpoint is used stop the device scan operation for all gateways.
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}}
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 device’s euid
{{host}}app/v1/device/{device_euid}/capability
Response Key Explanation
Key | Type | Explanation |
---|---|---|
supported_capabilities | Array | Capabilities supported by the device |
{ “supported_zcl_capability”: [ { “endpoint”: [ “Array of supported clusters” ] } ] }
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}}
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 47 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:23:46 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to control the device. The URL should contain the device’s euid
{{host}}app/v1/device/{device_euid}/zclcapability/
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 |
---|---|---|
endpoint_id | String | Endpoint ID of the device |
cluster_id | String | Cluster ID of the device on which operation is being carried out |
parent_command | String | Parent Command of the cluster on which operation is being carried out |
command_id | String | Command ID of the command which is being carried out |
params | Dict | Params needed for this command |
sub_command | String | This field is optional for those commands which are defined in the RIoT specification. User needs to provide the sub_command in the request payload only for those commands which are alien to the RIoT specification. |
The endpoint accepts only the above mentioned fields 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 '{
"endpoint_id": "1",
"cluster_id": "0x0101",
"command_id": "0x00",
"parent_command": "zcl lock",
"params": {
"pin": "{1234}"
}
}' "{{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}}
{
"endpoint_id": "1",
"cluster_id": "0x0101",
"command_id": "0x00",
"parent_command": "zcl lock",
"params": {
"pin": "{1234}"
}
}
Status | 200 OK |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 21 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 12:46:23 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 400 Bad Request |
---|---|
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to get the last updated value of a cluster_id-attribute_id combination of a device which has communicated with the RIoT controller. This also requests the device to read the latest value for a cluster_id-attribute_id combination. The URL should contain the device’s euid
{{host}}app/v1/device/{device_euid}/zclattribute?clust_id=0x0000&attr_id=0x0000&endpoint_id=1
Response Key Explanation
Key | Type | Explanation |
---|---|---|
endpoint_id | String | endpoint supported by the device |
cluster_id | String | hexadecimal string of the cluster Id |
attribute_id | String | hexadecimal string of the attribute Id |
reported_value | Dictionary | dictionary has device reported value |
reported_value_name | String | name of the reported value |
{ | ||
“endpoint_id”: “1”, | ||
“reported_value_name”: “Undefined”, | ||
“attribute_id”: “0x0000”, | ||
“cluster_id”: “0x0000”, | ||
“reported_value”: { | ||
“value”: “0x02” | ||
} | ||
} |
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 "Content-Type: application/json" -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/device/28:6D:97:00:01:08:38:4B/zclattribute?clust_id=0x0000&attr_id=0x0000&endpoint_id=1"
GET %7B%7Bhost%7D%7D/app/v1/device/28:6D:97:00:01:08:38:4B/zclattribute?clust_id=0x0000&attr_id=0x0000&endpoint_id=1 HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
This endpoint is a token-auth protected endpoint.
This endpoint is used to control the device by writing on a particular Cluster ID-Attribute ID combination. The URL should contain the device’s euid
{{host}}app/v1/device/{device_euid}/zclattribute
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 |
---|---|---|
endpoint_id | String | Endpoint ID of the device |
cluster_id | String | Cluster ID of the device on which operation is being carried out |
attribute_id | String | Attribute ID of the cluster on which operation is being carried out |
data | String | Value which is being set for this Cluster ID- Attribute ID combination |
is_private | Boolean | It is False by default for standard ZigBee commands. For executing private ZigBee commands on a device, user needs to pass this field with value True. |
data_type | String | This field is optional for those Cluster ID- Attribute ID combinations which are defined in the RIoT specification. User needs to provide the data_type of the attribute for writing data on those Cluster ID- Attribute ID combinations which are alien to the RIoT specification. |
data_type_id | String | This field is optional for those Cluster ID- Attribute ID combinations which are defined in the RIoT specification. User needs to provide the data_type_id of the attribute for writing data on those Cluster ID- Attribute ID combinations which are alien to the RIoT specification. |
The endpoint accepts only the above mentioned fields 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 '{
"endpoint_id": "1",
"cluster_id": "0x0202",
"attribute_id": "0x0000",
"data": "0x06",
"is_private": false
}
' "{{host}}/app/v1/device/24:FD:5B:00:01:08:74:FE/zclattribute"
PUT %7B%7Bhost%7D%7D/app/v1/device/24:FD:5B:00:01:08:74:FE/zclattribute HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
{
"endpoint_id": "1",
"cluster_id": "0x0202",
"attribute_id": "0x0000",
"data": "0x06",
"is_private": false
}
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/insights?line_num=100&search_string=responding"
GET %7B%7Bhost%7D%7D/app/v1/insights?line_num=100&search_string=responding HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Status | 0 |
---|---|
|
Events by line num
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/app/v1/insights?line_num=100"
GET %7B%7Bhost%7D%7D/app/v1/insights?line_num=100 HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Status | 0 |
---|---|
|
These are the set of APIs which enable CRUD operations for the gateways in RIoT controller.
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}}
Status | 200 OK |
---|---|
nginx | |
Wed, 14 Jul 2021 05:58:44 GMT | |
application/json | |
5494 | |
keep-alive | |
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS | |
Origin | |
SAMEORIGIN | |
SAMEORIGIN | |
max-age=63072000 | |
|
Status | 401 Unauthorized |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 63 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:44:19 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to get the list of gateways based on certain parameters. Any gateway(s) conforming with these parameters will be returned in the response of this endpoint.
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 |
set_vlan_id | Integer | Vlan ID configured by the user |
domain_name | String | Domain Name where the Gateway is configured |
country_code | String | Tx Power conforms values to this country |
ctl_host | String | CTL Host where the Gateway is configured |
gateway_name | String | Name of the gateway |
domain_id | String | Domain Id where the Gateway is configured |
zone_id | String | Zone ID where the Gateway is configured |
set_vlan_enable | Integer | Whether Vlan is enabled by the user |
model | String | Ruckus Model of the Gateway |
zone_name | String | Zone name where the Gateway is configured |
ap_firmware | String | AP version |
usb_power | Integer | Whether Gateway can supply enough power for dongle |
legacy_zigbee_support | Boolean | Whether legacy zigbee devices are supported by this AP |
apgroup_name | String | Group Name where the Gateway is configured |
get_vlan_id | Integer | Vlan Id of Gateway |
apgroup_id | String | Group Id where the Gateway is configured |
get_vlan_enable | Integer | If Vlan is enabled |
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 |
get_iot_coex | Boolean | Whether Coex is enabled |
iot_module | String | IoT Module of this radio |
set_network_type | String | Network Type of this radio configured by the user |
set_ble_plugins | Array | Plugins configured by User |
zb_max | Integer | Max txpower value for zigbee which can be set on this radio |
set_iot_coex | Boolean | Coex as configured by the user |
mode_change | Integer | Whether mode can be changed for this radio |
scan_capable | Boolean | Whether scanning is allowed for this radio |
iot_model | String | Model of dongle for this radio |
get_network_id | String | Network Id of this radio |
ble_max | Integer | Max txpower value for ble which can be set on this radio |
get_ble_plugins | Array | Ble plugins active on this radio |
network_status | String | Whether the radio is available or not |
get_network_type | String | Network Type of this radio |
plugin_capable | Boolean | Wheter plugin can be enabled |
set_network_id | String | Network Id configured by User |
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}}
Status | 401 Unauthorized |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 63 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:44:19 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|
Status | 200 OK |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 3172 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:23:47 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
x-frame-options | SAMEORIGIN |
|
Status | 200 OK |
---|---|
nginx | |
Wed, 14 Jul 2021 05:59:22 GMT | |
application/json | |
5497 | |
keep-alive | |
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS | |
Origin | |
SAMEORIGIN | |
SAMEORIGIN | |
max-age=63072000 | |
|
This endpoint is a token-auth protected endpoint.
This API returns the details of different beacons pertaining to different vendors which have advertised themselves to an IoT Gateway
{{host}}/app/v1/beacon?gateway_euid=D8:87:32:E7:1A:00
Response Key Explanation
Key | Type | Explanation |
---|---|---|
gateway_euid | string | Mac address of the gateway |
data | Array | array contains the gateway_beacons |
{ “meta”: { “limit”: 10, “offset”: 0, “query”: “{‘gateway_euid’: [‘D8:87:32:E7:1A:00’]}“, “total_count”: 11 }, “data”: [ { “gateway_beacons”: [ { “latitude”: “0”, “longitude”: “0”, “vendor_id”: “0x004C”, “events”: [ { “data”: “0201061AFF4C000215E2C56DB5DFFB48D2B060D0F5A710893E88AB0401C3”, “rssi”: “-88”, “deviceAddress”: “00:00:90:FD:9F:7C:2C:C2”, “timestamp”: 1606300392486 }, { “data”: “0201061AFF4C0002150047E70A5DC147258799830544AE04F60102000000”, “rssi”: “-60”, “deviceAddress”: “00:00:90:FD:9F:7C:33:41”, “timestamp”: 1606300392102 }
]
}
],
"gateway_euid": "D8:87:32:E7:1A:00"
}
] }
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/beacon?gateway_euid=D8:87:32:E7:1A:00"
GET %7B%7Bhost%7D%7D/app/v1/beacon?gateway_euid=D8:87:32:E7:1A:00 HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Status | 401 Unauthorized |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 63 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:44:19 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|
Status | 200 OK |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 3172 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:23:47 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
x-frame-options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to search the detailed list of gateways added under the account based on the search string provided by the user. 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 |
set_vlan_id | Integer | Vlan ID configured by the user |
domain_name | String | Domain Name where the Gateway is configured |
country_code | String | Tx Power conforms values to this country |
ctl_host | String | CTL Host where the Gateway is configured |
gateway_name | String | Name of the gateway |
domain_id | String | Domain Id where the Gateway is configured |
zone_id | String | Zone ID where the Gateway is configured |
set_vlan_enable | Integer | Whether Vlan is enabled by the user |
model | String | Ruckus Model of the Gateway |
zone_name | String | Zone name where the Gateway is configured |
ap_firmware | String | AP version |
usb_power | Integer | Whether Gateway can supply enough power for dongle |
legacy_zigbee_support | Boolean | Whether legacy zigbee devices are supported by this AP |
apgroup_name | String | Group Name where the Gateway is configured |
get_vlan_id | Integer | Vlan Id of Gateway |
apgroup_id | String | Group Id where the Gateway is configured |
get_vlan_enable | Integer | If Vlan is enabled |
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 |
get_iot_coex | Boolean | Whether Coex is enabled |
iot_module | String | IoT Module of this radio |
set_network_type | String | Network Type of this radio configured by the user |
set_ble_plugins | Array | Plugins configured by User |
zb_max | Integer | Max txpower value for zigbee which can be set on this radio |
set_iot_coex | Boolean | Coex as configured by the user |
mode_change | Integer | Whether mode can be changed for this radio |
scan_capable | Boolean | Whether scanning is allowed for this radio |
iot_model | String | Model of dongle for this radio |
get_network_id | String | Network Id of this radio |
ble_max | Integer | Max txpower value for ble which can be set on this radio |
get_ble_plugins | Array | Ble plugins active on this radio |
network_status | String | Whether the radio is available or not |
get_network_type | String | Network Type of this radio |
plugin_capable | Boolean | Wheter plugin can be enabled |
set_network_id | String | Network Id configured by User |
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}}
Status | 200 OK |
---|---|
nginx | |
Wed, 14 Jul 2021 05:59:39 GMT | |
application/json | |
2908 | |
keep-alive | |
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS | |
Origin | |
SAMEORIGIN | |
SAMEORIGIN | |
max-age=63072000 | |
|
Status | 401 Unauthorized |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 63 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:44:19 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|
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}
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 |
set_vlan_id | Integer | Vlan ID configured by the user |
domain_name | String | Domain Name where the Gateway is configured |
country_code | String | Tx Power conforms values to this country |
ctl_host | String | CTL Host where the Gateway is configured |
gateway_name | String | Name of the gateway |
domain_id | String | Domain Id where the Gateway is configured |
zone_id | String | Zone ID where the Gateway is configured |
set_vlan_enable | Integer | Whether Vlan is enabled by the user |
model | String | Ruckus Model of the Gateway |
zone_name | String | Zone name where the Gateway is configured |
ap_firmware | String | AP version |
usb_power | Integer | Whether Gateway can supply enough power for dongle |
legacy_zigbee_support | Boolean | Whether legacy zigbee devices are supported by this AP |
apgroup_name | String | Group Name where the Gateway is configured |
get_vlan_id | Integer | Vlan Id of Gateway |
apgroup_id | String | Group Id where the Gateway is configured |
get_vlan_enable | Integer | If Vlan is enabled |
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 |
get_iot_coex | Boolean | Whether Coex is enabled |
iot_module | String | IoT Module of this radio |
set_network_type | String | Network Type of this radio configured by the user |
set_ble_plugins | Array | Plugins configured by User |
zb_max | Integer | Max txpower value for zigbee which can be set on this radio |
set_iot_coex | Boolean | Coex as configured by the user |
mode_change | Integer | Whether mode can be changed for this radio |
scan_capable | Boolean | Whether scanning is allowed for this radio |
iot_model | String | Model of dongle for this radio |
get_network_id | String | Network Id of this radio |
ble_max | Integer | Max txpower value for ble which can be set on this radio |
get_ble_plugins | Array | Ble plugins active on this radio |
network_status | String | Whether the radio is available or not |
get_network_type | String | Network Type of this radio |
plugin_capable | Boolean | Wheter plugin can be enabled |
set_network_id | String | Network Id configured by User |
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/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}}
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | keep-alive |
Content-Length | 1337 |
Content-Type | application/json |
Date | Wed, 21 Nov 2018 11:04:36 GMT |
Server | nginx |
Strict-Transport-Security | max-age=63072000 |
X-Frame-Options | SAMEORIGIN |
X-Frame-Options | SAMEORIGIN |
|
Status | 404 Not Found |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | close |
Content-Length | 121 |
Content-Type | application/json |
Date | Wed, 26 Jul 2017 11:48:32 GMT |
Server | gunicorn/19.6.0 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is be used to get the count of APs with most Devices.
{{host}}app/v1/dashboard/gatewaynames
Response Key Explanation
Key | Type | Explanation |
---|---|---|
gateway_euid | int | has the value AP mac address |
gateway_name | string | has the value AP name |
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 "Authorization: Token {{auth_token}}" "{{host}}/app/v1/gatewaynames"
GET %7B%7Bhost%7D%7D/app/v1/gatewaynames HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Status | 200 OK |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 3172 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:23:47 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
x-frame-options | SAMEORIGIN |
|
Status | 401 Unauthorized |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 63 |
content-type | application/json |
date | Mon, 04 Sep 2017 15:44:19 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|
This endpoint is a token-auth protected endpoint.
This endpoint is used to approve or unapprove a single gateway by providing required details for the gateway. The URL should contain the gateway’s euid
{{host}}app/v1/gateway/{gateway_euid}/management/IOT_APPROVED
Request Key Explanation
Key | Type | Explanation |
---|---|---|
iot_approved | Boolean | Whether the gateway is approved |
The endpoint accepts only iot_approved
. If any other fields are passed the endpoint will return error 400 Bad Request
.
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 "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
}
This endpoint is a token-auth protected endpoint.
This endpoint is used to approve or unapprove a single gateway by providing required details for the gateway. The URL should contain the gateway’s euid
{{host}}app/v1/gateway/{gateway_euid}/management/VLAN_ENABLE
Request Key Explanation
Key | Type | Explanation |
---|---|---|
vlan_enable | Boolean | Whether vlan is enabled on the gateway |
vlan_id | Integer | vlan_id operating on this gateway |
vlan_mode | String | Whether mode is ONLINK or OFFLINK |
The endpoint accepts only vlan_id
, vlan_mode
and vlan_enable
. If any other fields are passed the endpoint will return error 400 Bad Request
. We can use this endpoint for disabling vlan also. In that scenario vlan_enable will be false and vlan_id will be 0.
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 POST -H "Authorization: Token {{auth_token}}" -H "Content-Type: application/json" -d '[
{
"JoinOnDuration": 255,
"ZigBeeNetworkControlType": 5,
"MessageID": 3,
"MessageTime": "2021-08-30T19:55:34.1494609Z",
"MessageSequence": 324,
"MessageExpiry": 255,
"GatewayID": 6,
"GatewayUniqueID": "NCDjLSdw",
"GatewayType": 2,
"Priority": 127,
"TimeBaseEpoch": 0,
"ControllerType": 0,
"GatewayControlType": 65535,
"ServerDomain": null,
"TransactionID": 324,
"TransactionType": 610,
"ExternalDeviceId": 0,
"GracePeriod": 0,
"MacAddress": "0CF4D51E2210",
"ServerName": "",
"HubTypeCode": 11
}
]' "{{host}}/app/v1/gatewayService"
POST %7B%7Bhost%7D%7D/app/v1/gatewayService HTTP/1.1
Host:
Authorization: Token {{auth_token}}
Content-Type: application/json
[
{
"JoinOnDuration": 255,
"ZigBeeNetworkControlType": 5,
"MessageID": 3,
"MessageTime": "2021-08-30T19:55:34.1494609Z",
"MessageSequence": 324,
"MessageExpiry": 255,
"GatewayID": 6,
"GatewayUniqueID": "NCDjLSdw",
"GatewayType": 2,
"Priority": 127,
"TimeBaseEpoch": 0,
"ControllerType": 0,
"GatewayControlType": 65535,
"ServerDomain": null,
"TransactionID": 324,
"TransactionType": 610,
"ExternalDeviceId": 0,
"GracePeriod": 0,
"MacAddress": "0CF4D51E2210",
"ServerName": "",
"HubTypeCode": 11
}
]
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_euid | String | The MAC address or the identifier of the gateway |
By default, the gateway_name
and the gateway_euid
of the gateway will be added to the tags.
The endpoint accepts only gateway_tags
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"
}
Status | 201 Created |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 177 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 13:14:51 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
Status | 409 Conflict |
---|---|
Access-Control-Allow-Origin | * |
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Content-Length | 118 |
Content-Type | application/json |
Date | Tue, 25 Jul 2017 13:15:26 GMT |
Server | WSGIServer/0.2 CPython/3.5.2 |
Vary | Cookie |
X-Frame-Options | SAMEORIGIN |
|
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 |
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
. 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"]
}
Status | 200 OK |
---|
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
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"
}
]
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",
"Action": "update"
},
{
"Tags": "Gateway BDC|D8:38:FC:25:BB:67",
"IoT AP MAC": "D8:38:FC:25:E7:68",
"Action": "update"
}
]' "{{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",
"Action": "update"
},
{
"Tags": "Gateway BDC|D8:38:FC:25:BB:67",
"IoT AP MAC": "D8:38:FC:25:E7:68",
"Action": "update"
}
]
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
This section describes the set of gateway APIs which are used to interact with the Ruckus RIoT gateway.
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.
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}}
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,
"network_mac":"90:FD:9F:FF:FE:0C:89:36"
}' "{{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,
"network_mac":"90:FD:9F:FF:FE:0C:89:36"
}
This endpoint is a token-auth protected endpoint.
This endpoint is used to set the dongle Tx power for the network when the IoT network starts. The URL should contain the gateways’ euid.
{{host}}app/v1/gateway/{gateway_euid}/TX_POWER
Once the API is called the Tx Power in the gateway is set and the IoT process will reboot.
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 its 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 |
---|---|---|
tx_power | Integer | The Tx power in which the dongle should start the network |
The tx_power
will accept Integer values between 0-20.
The endpoint accepts only 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 '{
"tx_power": 0,
"network_mac":"90:FD:9F:FF:FE:0C:89:36"
}' "{{host}}/app/v1/gateway/D8:38:FC:25:BB:60/management/TX_POWER"
PUT %7B%7Bhost%7D%7D/app/v1/gateway/D8:38:FC:25:BB:60/management/TX_POWER HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
{
"tx_power": 0,
"network_mac":"90:FD:9F:FF:FE:0C:89:36"
}
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 its 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 dongle should start the network |
pan_index | int | The index in the dongle |
network_mac | string | The network mac of the dongle |
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",
"pan_index":1
"network_mac":"90:FD:9F:FF:FE:0C:89:36"
}' "{{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",
"pan_index":1
"network_mac":"90:FD:9F:FF:FE:0C:89:36"
}
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"
}
]
curl -X GET -H "Authorization: Token {{auth_token}}" "{{host}}/service/v1/service-details"
GET %7B%7Bhost%7D%7D/service/v1/service-details HTTP/1.1
Host:
Authorization: Token {{auth_token}}
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}}' "{{host}}/service/init"
POST %7B%7Bhost%7D%7D/service/init HTTP/1.1
Host:
Content-Type: application/json
Authorization: Token {{auth_token}}
{"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}}
curl -X POST -H "Authorization: Token {{auth_token}}" "{{host}}/reset"
POST %7B%7Bhost%7D%7D/reset HTTP/1.1
Host:
Authorization: Token {{auth_token}}
curl -X PATCH -H "Content-Type: application/json" -d '{
"configurations":{
"hostname":"vriot",
"systemtime":["0","06/21/2018 09:00:10"]
}
}' "{{host}}/service/init"
PATCH %7B%7Bhost%7D%7D/service/init HTTP/1.1
Host:
Content-Type: application/json
{
"configurations":{
"hostname":"vriot",
"systemtime":["0","06/21/2018 09:00:10"]
}
}
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 |
enable_all | Boolean | Whether plugin has been activated on all BLE Gateways |
services | Boolean | Whether a separate service will be running for this plugin |
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}}
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 |
enable_all | Boolean | Whether plugin needs to be activated on all BLE Gateways |
The endpoint accepts only vendor_id
, vendor_name
, package_name
, enable_all
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 |
enable_all | Boolean | Whether plugin has been activated on all BLE Gateways |
services | Boolean | Whether a separate service will be running for this plugin |
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": {
},
"enable_all": false
}' "{{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": {
},
"enable_all": false
}
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 |
enable_all | Boolean | Whether plugin has been activated on all BLE Gateways |
The endpoint accepts only settings
and enable_all
. 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 |
enable_all | Boolean | Whether plugin has been activated on all BLE Gateways |
services | Boolean | Whether a separate service will be running for this plugin |
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": {
},
"enable_all": false
}' "{{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": {
},
"enable_all": false
}
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}}
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}}
Status | 200 OK |
---|---|
|
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.
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}}
Status | 200 OK |
---|---|
Allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
Connection | keep-alive |
Content-Length | 65 |
Content-Type | application/json |
Date | Wed, 21 Nov 2018 10:45:35 GMT |
Server | nginx |
Strict-Transport-Security | max-age=63072000 |
X-Frame-Options | SAMEORIGIN |
X-Frame-Options | SAMEORIGIN |
|
Status | 401 Unauthorized |
---|---|
allow | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
content-length | 63 |
content-type | application/json |
date | Mon, 04 Sep 2017 12:45:50 GMT |
server | WSGIServer/0.2 CPython/3.5.2 |
www-authenticate | token |
x-frame-options | SAMEORIGIN |
|