0% found this document useful (0 votes)
53 views

AP Northbound-API-User-Guide - v1.9

The document is an API user guide that details changes made to the content by JiangYan Yu and Daniel Duan on various dates. It provides instructions on accessing APIs, including getting the PVC IP address, logging in, making API calls, and logging out. It also describes the available API objects - user, ap, system, wlan, rf, and downloader - and includes details on specific API methods for objects like getting AP system info and setting a static IP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

AP Northbound-API-User-Guide - v1.9

The document is an API user guide that details changes made to the content by JiangYan Yu and Daniel Duan on various dates. It provides instructions on accessing APIs, including getting the PVC IP address, logging in, making API calls, and logging out. It also describes the available API objects - user, ap, system, wlan, rf, and downloader - and includes details on specific API methods for objects like getting AP system info and setting a static IP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

API User Guide

Change records
JiangYan Yu 20-11-2017 The first draft is completed;
JiangYan Yu 30-11-2017 The content is changed as follows:

1. Optimize the visit process.


2. Reclassify the interface object.
3. Add parameter description.
JiangYan Yu 21-12-2017 The content is changed as follows:

1. Modify the response message of each method


2. Modify the description of each method parameter.
3. Modify the user.logOut request contents.
4. Modify the group.get response contents.
5. Modify the wlan object.

JiangYan Yu 08-01-2018 The content is changed as follows:

1. Delete wlan.enable.
JiangYan Yu 29-01-2018 The content is changed as follows:

1. Delete group object.


2. Modify wlan object.
JiangYan Yu 09-02-2018 The content is changed as follows:

1. user.logIn added a limit.


2. wlan info added two parameters : e0211kStatus, e0211vStatus.
3. wlan.create added a limit.
JiangYan Yu 02-03-2018 The content is changed as follows:

1. Modify the ‘Request period Parameters’ of the wlan.create method.

JiangYan Yu 12-03-2018 The content is changed as follows:

1. Add system.getApList method.


2. Modify the location fields in the return value of the ap.getSystemInfo method.
3. Modify the wlanTimer of the wlan object.
4. Delete all the fields that show the plaintext password in the return value of the wlan.get method.
(passphrase, authSecret, accountSecret)

JiangYan Yu 27-03-2018 The content is changed as follows:

1. Modify System.getPvc method so that its username can only be Administrator.


JiangYan Yu 20-06-2018 The content is changed as follows:

1. Add ap.setStaticIp method.


2. Add system.setPassword method.
3. Added description of API support version.
4. Modify the note of the wlan.create method.
5. Modify the description of the system.saveConfig method.
6. Modify the description of the password parameter in user.logIn and system.getPvc.

JiangYan Yu 15-07-2018 The content is changed as follows:

1. Add system.setGroupInfo method.


2. Add wlan.list method.
3. Modify the request parameters of the ap.setStaticIp.

JiangYan Yu 17-07-2018 The content is changed as follows:


1. Modify the Note description of the Request in the system.setGroupInfo method.
2. Add the Note description of the Request in the user.logIn method.

JiangYan Yu 26-09-2018 The content is changed as follows:

1. Add description of the ap_bridge parameter.

Daniel Duan 19-03-2019 The content is changed as follows:

1. Add how to modify WLAN attributes by wlan.create method.

JiangYan Yu 09-07-2019 The content is changed as follows:


1. Add rf.setRadio method.

JiangYan Yu 29-09-2019 The content is changed as follows:


1. Add a node to the system.getApList method.

JiangYan Yu 25-02-2020 The content is changed as follows:

1. Add the effective value(wpa3) of the encryptionType parameter in the wlan.create method.

JiangYan Yu 18-03-2020 The content is changed as follows:

1. Add the pmf parameter in the wlan.create method and wlan.get method.

JiangYan Yu 02-08-2022 The content is changed as follows:


1. Add downloader.oneclickCollectionLog method.

How to access API interface in Express mode


Northbound API supports R3.0.3 (include 3.0.3) or later.

For the Northbound requirements, we provide six objects: user, ap, system, wlan, rf,downloader.

1. Access to non-download APIs


When the access is not the downloader object, the visit process is as follows:

Step 1: Get PVC IP address

The web developer first needs to call the system.getPvc method via the following url to get the pvcip.

Url:
http://anyip address:8080/apiaccess

Step 2: Login to PVC

After that through the following url with pvcip call user.logIn method to get the session.

Url:

http://pvcip address:8080/apiaccess

If the PVC switch, you need to re-run Step1 to get a new pvcip.

Step 3: API access

After that through the following url with pvcip call other methods, each call must carry the session.

Url:

http://pvcip address:8080/apiaccess

If no method is called within 10 minutes, the session will be invalid.

Only by re-executing Step2 to get a valid session, other methods can be called normally.

Step 4: Logout

Finally, when you no longer call other methods, you need to call the user.log_out method to delete the
session by using the following url.

Url:

http://pvcip address:8080/apiaccess

2. Access the download API


Choose one AP which is going to download logs, directly access that AP through the username & password.
(Chaper API details, Section 6 download object)

Url:

http://Desired AP ip address:8080/apiaccess

API details

1.user object
For the user object, provide two methods: user.logIn, user.logOut.

user.logIn

Description:

This is the login method.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "user.logIn",
"params": {
"username":"Administrator",
"password":"21232f297a57a5a743894a0e4a801fc3"
}
}
Note:
1.Only use the Administrator account to log in.
2.The value of id ranges from -2147483648 to 2147483647. If the value you set for the id is
greater than the maximum, it will return you 2147483647. If the value you set for the id is less
than the minimum value, it will return you -2147483648.
3.The id in all of the following methods are like this. I would like to explain here, and I
won't repeat it later.

Request Parameters:

params type description

username string The username is Administrator.

The default password is 21232f297a57a5a743894a0e4a801fc3. This is the


password string
md5 hash of “admin”.

Response:
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Login success/Login log account lock/Login log Password
error xxx/Login log account banned/Login log saveSessionid error/login log saveSessionValid
error/Please access pvc/No params/No username/No password/Can not get password/The username is
not Administrator",
"sessionId":"2eb79fc698f7894349fe2605f37fdf3e"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface


success string
fails to call, this parameter is false.

message string Return the result information of the call.

Valid session, call other methods must be carry it. If success is false, then
sessionId string
there will be no sessionId parameter.

user.logOut

Description:

This is the logout method.

Request:

{
"id": 4,
"jsonrpc": "2.0",
"method": "user.logOut",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {}
}

Response:
{
"id": 4,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/Log out success/Log out fail/Please access
pvc"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

2.ap object
For the ap object, provide three methods: ap.getSystemInfo, ap.getClient, ap.setStaticIp.

ap.getSystemInfo

Description:

Show AP details (AP Model, AP MAC, AP IP, UP time, AP SW version running).

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "ap.getSystemInfo",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"apmac":"aa:bb:cc:dd:ee:ff"
}
}

Request Parameters:

params type description

apmac string An ap mac.


Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"apinfo":{
"model": "OAW-AP1221",
"mac": "aa:bb:cc:dd:ee:ff",
"ip": "192.168.20.1",
"uptime": 95458,
"version": "3.0.0.57",
"location": "home"
},
"success": "true/false",
"message": "No id/No method/Invalid session/Please access pvc/No params/Ubus lookup id
failed/Ubus call nbm failed, status = xxx/Failed to get nbm return value/No topic/Mqtt pub
fail/Mqtt timeout/Get ap info success"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface


success string
fails to call, this parameter is false.

message string Return the result information of the call.

apinfo object The details of ap. If success is false, then there will be no apinfo object.

model string Return ap's model, it belongs to apinfo object.

mac string Return ap's mac, it belongs to apinfo object.

ip string Return the ip address of ap, it belongs to apinfo object.

uptime int Return the total seconds of ap run time.

version string Return ap's version, it belongs to apinfo object.

location string Return ap's location, it belongs to apinfo object.

ap.getClient

Description:

Get the total number of clients connected on an ap, and also get the list of client connected on
an ap.
Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "ap.getClient",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"apmac":"aa:bb:cc:dd:ee:ff"
}
}

Request Parameters:

params type description

apmac string An ap mac.

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"total": 1,
"users": [
{
"on_line": true,
"mac": "b0:e2:35:24:e6:54",
"ap": "46:07:5a:fa:a2:6a",
"vap": "46:07:5a:fa:a2:77",
"wlanid": 3,
"radioid": 1,
"AssocationSSID": "123",
"AttachedBand": 5,
"Channel": 161,
"AuthType": "OPEN",
"Portal_username": "",
"ip": "192.168.20.189",
"uptime": 15,
"livetime": 0,
"signal": 35,
"mode": 19,
"rx_rate": 390000,
"rx_wifirate": 1733300,
"rx_bytes": 72129,
"tx_rate": 27000,
"tx_wifirate": 1733300,
"tx_bytes": 53132,

"portal_enable": false,
"portal_type": "wifidog",
"portal_state": "know",
"devtype": "Mobile",
"hostname": "MI5-xiaomishouji",
"ostype": "Android",
"devmodel": "",
"cputype": "",
"delaytime": 9999999,
"packetloss": 100,
"rx_retr": 0,
"tx_retr": 0,
"up_package": 165,
"down_package": 735,
"up_rate": 6,
"down_rate": 4
}
]
"success": "true/false",
"message": "No id/No method/Invalid session/Please access pvc/No params/Ubus lookup id
failed/Ubus call nbm failed, status = xxx/Failed to get nbm return value/No topic/Mqtt pub
fail/Mqtt timeout/Get clients success/Um return error"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

Return the total number of clients connected on an ap. If success parameter is


total int
false, then there will be no total parameter.

Return the list of clients info connected on an ap. If success parameter is false,
users array
then there will be no users parameter.

ap.setStaticIp

Description:

Set the static IP of an AP.


After the ap.setStaticIp method is executed, if the result shows that the setting is successful,
the set Ap takes about 2 minutes to resume communication.

Request:
{
"id": 1,
"jsonrpc": "2.0",
"method": "ap.setStaticIp",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"apmac":"aa:bb:cc:dd:ee:ff",
"staticip":"192.168.20.188",
"netmask":"255.255.254.0",
"gateway":"192.168.21.254",
"dns":"219.141.136.10"
}
}

Request Parameters:

params type description

apmac string An mac of the ap in the group

ip string A valid IP address

netmask string A valid netmask address

gateway string A valid gateway value

The netmask string A valid dns value

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/The parameter is
wrong: xxx/Mqtt pub fail/Mqtt timeout/Apmanage return error/Set ip fail/Set ip success"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.


3.system object
For the system object, provide five methods: system.saveConfig, system.getPvc,system.getApList,
system.setPassword, system.setGroupInfo.

system.saveConfig

Description:

Save the configuration for the cluster.


This method is to prevent configuration loss when the AP suddenly loses power.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "system.saveConfig",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {}
}

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/Please access pvc/Ubus lookup id failed/Ubus
call nbm failed, status = xxx/Failed to get nbm return value/Mqtt pub fail/Mqtt timeout/Uc
return error/Save config success"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

system.getPvc

Description:
Show which ap is the pvc. Accessed by username & password

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "system.getPvc",
"params": {
"username":"Administrator",
"password":"21232f297a57a5a743894a0e4a801fc3"
}
}
Note: Only use the Administrator account to log in.

Request Parameters:

params type description

username string The username is Administrator.

The default password is 21232f297a57a5a743894a0e4a801fc3. This is the


password string
md5 hash of “admin”.

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"pvcip": "192.168.20.1",
"success": "true/false",
"message": "No id/No method/Get pvc success/Can not get password/Password wrong/No
params/No username/No password/The username is not Administrator"
}
}

Return Values:
result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

Return the ip address of pvc. The web developer first needs to call the method
pvcip string
to get the pvcip. If success is false, then there will be no pvcip parameter.

system.getApList

Description:

Get the Ap List for the cluster.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "system.getApList",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {}
}

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"aps": [
{
"ap_name": "AP-2B:E0",
"mac": "b0:e2:35:24:2b:e0",
"ip": "192.168.20.189",
"status": 3,
"role": 1,
"version": "3.0.3.13"
},
{
"ap_name": "AP-E6:54",
"mac": "b0:e2:35:24:e6:54",
"ip": "192.168.20.182",
"status": 3,
"role": 2,

"version": "3.0.3.13"
}
],
"success": "true/false",
"message": "No id/No method/Invalid session/Please access pvc/Ubus lookup id failed/Ubus
call nbm failed, status = xxx/Failed to get nbm return value/Can't execute command/Get aplist
success/The aplist is null"
}
}
Note: Before the PVC is not elected, the result obtained by calling this method is incorrect.
When there are many devices in the cluster, it may take a few minutes to elect PVC. When there
are few devices in the cluster, it may take a few seconds to elect a PVC.

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

aps array Please refer to [Return aps Values].

Return aps Values:

aps type description

ap_name string Return ap's name.

mac string Return ap's mac.

ip string Return the ip address of ap.

status integer Return ap's status. 1:Joining; 2:Initializing;3:Working;4:Down.

role integer Return ap's role. 1:PVC;2:SVC;3:VC.

version string Return ap's version.

system.setPassword

Description:

Set the admin password.

Request:
{
"id": 1,
"jsonrpc": "2.0",
"method": "system.setPassword",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"password": "e10adc3949ba59abbe56e057f20f883e"
}
}

Request Parameters:

params type description

password string The password is the md5 hash of a string.

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/No password/Mqtt pub
fail/Mqtt timeout/Apmanage return error/Set password success/Set password fail"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

system.setGroupInfo

Description:

Set the group info: name, location, management IP, management netmask, group ID.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "system.setGroupInfo",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"group_name": "AP-Group",
"group_location": "office",
"group_mgtip": "192.168.20.46",
"group_mgtnetmask": "255.255.254.0",
"group_id": 8888
}
}
Note:
1.Group will be reorganized if you modify the group_id, at the same time pvc may change.
After setting the group_id successfully, please wait 20s and then log in again.
2.The lighttpd certificate will be recreated and loaded if you modify the group_mgtip.
So you may not receive a reply.

Request Parameters:

params type validation description

1-25 letters, digits,


group_name string underlines or middle The group name must be filled.
bars

1-32 digits,letters or If you don't want to set the group


group_location string
underlines location, this field can not exist.

The group_mgtip and


group_mgtip string valid IP address group_mgtnetmask must be set or not
set together.

The group_mgtip and


valid netmask
group_mgtnetmask string group_mgtnetmask must be set or not
address
set together.

If you don't want to set the group id, this


group_id integer 1-9999 field can not exist. Its default value is
100.

Response:
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/The parameter is
wrong:xxx/The group ip and netmask must be set together/This group_mgtip can't be the same as
the ip of the aps in the group/The obtained pvcip is incorrect, and the groupip cannot be
verified/This group_mgtip and pvcip are not in a network segment/Mqtt pub fail/Mqtt
timeout/Apmanage return error/Set group info success/Set group info fail/Set group id success,
Please wait for 20s and then log in again"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

4.wlan object
For the wlan object, provide four methods: wlan.create, wlan.delete, wlan.get, wlan.list.

wlan.create

Description:

Create or modify the various type of essid. It can be controllable time based.
Allow creation of a essid as standard open.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "wlan.create",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"essid":"mywifi",
"actionrange":"group", //"group" or "all"
"groupList": [
"aa:bb:cc:dd:ee:f0",
"aa:bb:cc:dd:ee:f1",

"aa:bb:cc:dd:ee:f2"
],
"allowBand":"all",
"ssidEnable":"enable",
"hideSSID":"disable",
"securityLevel":"Personal", //"Personal" or "Open" or "Enterprise"
"encryptionType":"wpa3-psk-sae-aes",
"pmf":"Optional",
"passphrase":"12345678",
"ap_bridge":"enable",
"broadcastFilterARP":"disable",
"multicastOptimization":"disable",
"maxClientsPerBand":13,
"e0211rStatus":"disable",
"e0211kStatus":"disable",
"e0211vStatus":"disable",
"okcStatus":"enable",
"wlanTimer":{
"enable":false,
"periodType":"daily", //"daily" or "weekend" or "weekday"
"period":{
"enable":false, //false:all day, true:period start.
"startTime":"10:59", // hour and mins
"endTime":"22:59"
}
},
"upstreamBandwidth":3,
"downstreamBandwidth":4,
"redirectStatus":"disable",
"vlanNumber":123,
"AuthServer":{
"authenticationPort":1812,
"authIp":"192.168.21.123",
"authSecret":"2345678"
},
"radiusAccounting": true,
"AccServer":{
"accountingPort":1813,
"accountIp":"192.168.21.111",
"accountSecret":"123456"
}
}
}
Note:
1.No matter which ap is applied to each WLAN, the number of wlan configured for each radio band
can not more than seven.
2.If you want to modify an existing wlan, just execute the wlan.create method again.

Request Parameters:
params type validation description

Name that uniquely identifies a


1-32 characters except
wireless network. If the name
essid string space. It also can't begin
repeats, it will overwrite the wlan
with *. and end with \
with the same name.

If the actionrange is group, the


essid will be enabled/disabled in
actionrange enum group/all the group. If the actionrange is all,
the essid will be enabled/disabled
in all aps.

If the actionrange is group, the


groupList array Valid apmac list groupList need to be filled. If not, it
does not need to be filled.

Configures the radio frequency


band on which this essid will be
allowBand enum 2.4/5/all broadcast. You can select either
2.4 GHz, 5 GHz, or all to specify
both bands.

ssidEnable enum enable/disable Enables or disables the essid.

Enables or disables hiding of the


essid name in beacon frames.
hideSSID enum enable/disable
Note that hiding the essid does
very little to increase security.

securityLevel enum Open/Personal/Enterprise  

If the securityLevel is Open, the


encryptionType does not need to
be filled. If the securityLevel is
Personal, the encryptionType will
wpa-psk-tkip, wpa-psk-aes,
be one of the following values:
wpa-psk-aes-tkip, wpa2-
wpa-psk-tkip, wpa-psk-aes, wpa-
psk-tkip, wpa2-psk-aes,psk-
psk-aes-tkip, wpa2-psk-tkip, wpa2-
mixed+tkip+aes, psk2+aes,
psk-aes,psk-mixed+tkip+aes,
static-wep, dynamic-wep,
encryptionType enum psk2+aes, wpa3-sae-aes,wpa3-psk-
wpa-tkip, wpa-aes, wpa-
sae-aes, static-wep. If the
mixed+tkip+aes, wpa2-tkip,
securityLevel is Enterprise, the
wpa2-aes,wpa2+aes,wpa3-
encryptionType will be one of the
sae-aes,wpa3-psk-sae-
following values: dynamic-wep,
aes,wpa3-aes,wpa3-aes256
wpa-tkip, wpa-aes, wpa-
mixed+tkip+aes,wpa2-tkip, wpa2-
aes,wpa3-aes, wpa2+aes, wpa3-
aes256.
params type validation description

Protected Management Frames


(PMF) , 80211W support. How to fill
pmf enum Disabled/Optional/Required in the pmf value, please refer to
[Values Table Of The
EncryptionType and Pmf].

WPA passphrase. If the


8-63 characters except
securityLevel is Personal, this
passphrase string space. It also can't include
parameter needs to be filled. If not,
`="'
it does not need to be filled.

If the ap_bridge is enable, then


Client-Isolation is off. If the
ap_bridge enum enable/disable
ap_bridge is disable, then Client-
Isolation is on.

broadcastFilterARP enum enable/disable  

multicastOptimization enum enable/disable  

maxClientsPerBand integer 1-120  

If the securityLevel is Personal and


Enterprise, this parameter need to
e0211rStatus enum enable/disable
be filled. If not, it does not need to
be filled.

e0211kStatus enum enable/disable  

e0211vStatus enum enable/disable  

If the securityLevel is Enterprise,


okcStatus enum enable/disable this parameter need to be filled. If
not, it does not need to be filled.

Please refer to [Request


wlanTimer object  
wlanTimer Parameters]

upstreamBandwidth integer 0-65536  

downstreamBandwidth integer 0-65536  

If the securityLevel is Open, this


redirectStatus enum enable/disable parameter need to be filled. If not,
it does not need to be filled.

vlanNumber integer 0-4094  

authenticationPort: 1-
65535, authIp: valid IP, If the securityLevel is Enterprise,
AuthServer object authSecret: 1-64 characters these parameters need to be filled.
except space. It also can't If not, it does not need to be filled.
include `="'
params type validation description

If the securityLevel is Enterprise,


these parameters need to be
radiusAccounting bool true/false
filled.If not, it does not need to be
filled.

accountingPort: 1-65535, If the securityLevel is Enterprise


accountIp: valid IP, and the radiusAccounting is true,
AccServer object accountSecret: 1-64 these parameters need to be
characters except space. It filled.If not, it does not need to be
also can't include `="' filled.

Values Table Of The EncryptionType and Pmf:


Security Encryption
Pmf description
Level Type

This is a fixed value : Disabled. No


matter what you fill in (or not fill
PSK wpa-psk-tkip Disabled
in), the value that will take effect
is still "Disabled".

This is a fixed value : Disabled. No


matter what you fill in (or not fill
  wpa-psk-aes Disabled
in), the value that will take effect
is still "Disabled".

This is a fixed value : Disabled. No


wpa-psk-aes- matter what you fill in (or not fill
  Disabled
tkip in), the value that will take effect
is still "Disabled".

This is a fixed value : Disabled. No


matter what you fill in (or not fill
  wpa2-psk-tkip Disabled
in), the value that will take effect
is still "Disabled".

You must fill in one of these three


  wpa2-psk-aes Disable/Optional/Required values: Disabled / Optional /
Required.

You must fill in one of these three


psk-
  Disabled/Optional/Required values: Disabled / Optional /
mixed+tkip+aes
Required.

You must fill in one of these three


  psk2+aes Disabled/Optional/Required values: Disabled / Optional /
Required.

This is a fixed value : Optional. No


wpa3-psk-sae- matter what you fill in (or not fill
  Optional
aes in), the value that will take effect
is still "Optional".

This is a fixed value : Required. No


matter what you fill in (or not fill
  wpa3-sae-aes Required
in), the value that will take effect
is still "Required".

This is a fixed value : Disabled. No


matter what you fill in (or not fill
  static-wep Disabled
in), the value that will take effect
is still "Disabled".
Security Encryption
Pmf description
Level Type

This is a fixed value : Disabled. No


matter what you fill in (or not fill
Enterprise dynamic-wep Disabled
in), the value that will take effect
is still "Disabled".

This is a fixed value : Disabled. No


matter what you fill in (or not fill
  wpa-tkip Disabled
in), the value that will take effect
is still "Disabled".

This is a fixed value : Disabled. No


matter what you fill in (or not fill
  wpa-aes Disabled
in), the value that will take effect
is still "Disabled".

You must fill in one of these three


wpa-
  Disabled/Optional/Required values: Disabled / Optional /
mixed+tkip+aes
Required.

This is a fixed value : Disabled. No


matter what you fill in (or not fill
  wpa2-tkip Disabled
in), the value that will take effect
is still "Disabled".

You must fill in one of these three


  wpa2-aes Disable/Optional/Required values: Disabled / Optional /
Required.

You must fill in one of these three


  wpa2+aes Disabled/Optional/Required values: Disabled / Optional /
Required.

This is a fixed value : Optional. No


matter what you fill in (or not fill
  wpa3-aes Optional
in), the value that will take effect
is still "Optional".

This is a fixed value : Required. No


matter what you fill in (or not fill
  wpa3-aes256 Required
in), the value that will take effect
is still "Required".

Request wlanTimer Parameters:


wlanTimer type validation description

If this parameter is true, time control is valid. If


enable bool true/false
not, time control is invalid.

If the enable is true, this parameter need to


periodType enum daily/weekend/weekday
be filled. If not, it does not need to be filled.

Please refer to [Request If the enable is true, the period object need to
period object
period Parameters] be filled. If not, it does not need to be filled.

Request period Parameters:

Period type validation description

If the enable is false, this wlan effective all day. If not, this wlan
enable bool true/false
effective from startTime to endTime.

If the enable is true, this parameter need to be filled. If not, it


startTime string hour:mins
does not need to be filled.

If the enable is true, this parameter need to be filled. If not, it


endTime string hour:mins
does not need to be filled.

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/The parameter is
wrong: xxx/Mqtt pub fail/Mqtt timeout/Wlan return error/Create wlan fail/Create wlan success/The
number of wlan configured for each radio band can not more than seven"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.


wlan.create(For modify)

Description:

Use wlan.create method modify the wlan attributes.

For example:

If you want to disable the WLAN "mywifi", you just need to modify the value of the "ssidEnable"
to disable, other attributes should be kept consistent with before.

{
"id": 1,
"jsonrpc": "2.0",
"method": "wlan.create",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"essid":"mywifi",
"actionrange":"group", //"group" or "all"
"groupList": [
"aa:bb:cc:dd:ee:f0",
"aa:bb:cc:dd:ee:f1",
"aa:bb:cc:dd:ee:f2"
],
"allowBand":"all",
"ssidEnable":"disable",
"hideSSID":"disable",
"securityLevel":"Personal", //"Personal" or "Open" or "Enterprise"
"encryptionType":"wpa3-psk-sae-aes",
"pmf":"Optional",
"passphrase":"12345678",
"ap_bridge":"enable",
"broadcastFilterARP":"disable",
"multicastOptimization":"disable",
"maxClientsPerBand":13,
"e0211rStatus":"disable",
"e0211kStatus":"disable",
"e0211vStatus":"disable",
"okcStatus":"enable",
"wlanTimer":{
"enable":false,
"periodType":"daily", //"daily" or "weekend" or "weekday"
"period":{
"enable":false, //false:all day, true:period start.
"startTime":"59:10", // mins and hour
"endTime":"59:22"
}
},
"upstreamBandwidth":3,

"downstreamBandwidth":4,
"redirectStatus":"disable",
"vlanNumber":123,
"AuthServer":{
"authenticationPort":1812,
"authIp":"192.168.21.123",
"authSecret":"2345678"
},
"radiusAccounting": true,
"AccServer":{
"accountingPort":1813,
"accountIp":"192.168.21.111",
"accountSecret":"123456"
}
}
}
Note: No matter which ap is applied to each WLAN, the number of wlan configured for each radio
band can not more than seven.

wlan.delete

Description:

Delete the essid in a group.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "wlan.delete",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"essid":"mywifi"
}
}

Request Parameters:

params type description

essid string Name that uniquely identifies a wireless network.

Response:
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/No essid/Mqtt pub
fail/Mqtt timeout/Wlan return error/The essid is not exist/Delete wlan fail/Delete wlan success"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

wlan.get

Description:

Check if a given essid exists.


If it exists, return wlan information.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "wlan.get",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"essid":"mywifi"
}
}

Request Parameters:

params type description

essid string Name that uniquely identifies a wireless network.

Response:
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/The essid is not
exist/No essid/Get wlan info error/Get wlan info success",
"wlaninfo": {
"essid":"mywifi",
"actionrange":"group", //"group" or "all"
"groupList": [
"aa:bb:cc:dd:ee:f0",
"aa:bb:cc:dd:ee:f1",
"aa:bb:cc:dd:ee:f2"
],
"allowBand":"all",
"ssidEnable":"enable",
"hideSSID":"disable",
"securityLevel":"Enterprise",
"encryptionType":"wpa3-psk-sae-aes",
"pmf":"Optional",
"ap_bridge":"enable",
"broadcastFilterARP":"disable",
"multicastOptimization":"disable",
"maxClientsPerBand":13,
"e0211rStatus":"disable",
"e0211kStatus":"disable",
"e0211vStatus":"disable",
"okcStatus":"enable",
"wlanTimer":{
"enable":true,
"periodType":"daily", //"daily" or "weekend" or "weekday"
"period":{
"enable":true,
"startTime":"10:59", // hour and mins
"endTime":"22:59"
}
},
"upstreamBandwidth":3,
"downstreamBandwidth":4,
"redirectStatus":"disable",
"vlanNumber":123,
"AuthServer":{
"authenticationPort":1812,
"authIp":"192.168.21.123"
},
"radiusAccounting": true,
"AccServer":{
"accountingPort":1813,
"accountIp":"192.168.21.111"
}
}
}
}

Return Values:

result type description

If the interface is called successfully and the essid exists, this parameter is
success string true.If the interface fails to call or the essid doesn't exist, this parameter is
false.

message string Return the result information of the call.

If success is true, wlaninfo will display the details of the wlan. Please refer to
wlaninfo object
[Return wlanInfo Values] for details.

Return wlanInfo Values:


params type description

essid string Name that uniquely identifies a wireless network.

actionrange enum It means the application scope of the essid.

If the actionrange is group, the groupList will be displayed. If


groupList string
not, it will not to be displayed.

Configures the radio frequency band on which this essid will


allowBand enum
be broadcast.

ssidEnable enum Enables or disables the essid.

Enables or disables hiding of the essid name in beacon


hideSSID enum frames. Note that hiding the essid does very little to increase
security.

securityLevel enum  

If the securityLevel is Open, the encryptionType does not to


encryptionType enum
be displayed. If not, it will to be displayed.

pmf enum  

If the ap_bridge is enable, then Client-Isolation is off. If the


ap_bridge enum
ap_bridge is disable, then Client-Isolation is on.

broadcastFilterARP enum  

multicastOptimization enum  

maxClientsPerBand integer  

If the securityLevel is Personal and Enterprise, it will be


e0211rStatus enum
displayed. If not, it will not to be displayed.

e0211kStatus enum  

e0211vStatus enum  

If the securityLevel is Enterprise, it will be displayed. If not, it


okcStatus enum
will not to be displayed.

wlanTimer object  

upstreamBandwidth integer  

downstreamBandwidth integer  

If the securityLevel is Open, it will be displayed. If not, it will


redirectStatus enum
not to be displayed.

vlanNumber integer  
params type description

If the securityLevel is Enterprise, these parameters will be


AuthServer object
displayed. If not, these parameters will not to be displayed.

If the securityLevel is Enterprise, it will be displayed. If not, it


radiusAccounting bool
will not to be displayed.

If the securityLevel is Enterprise and the radiusAccounting is


AccServer object true, these parameters will be displayed. If not, these
parameters will not to be displayed.

wlan.list

Description:

List all existing SSID.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "wlan.list",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {}
}

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/Ubus lookup id failed/Ubus call nbm failed,
status = xxx/Failed to get nbm return value/Please access pvc/Get essid list fail/Get essid list
success",
"ssidList":[
"mywifi1",
"mywifi2",
"mywifi3"
]
}
}

Return Values:
result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

ssidList array Display ssid list.

5. rf object
For the rf object, provide one method: rf.setRadio.

rf.setRadio

Description:

Can turn on/off the radio of the AP.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "rf.setRadio",
"session": "038e1d7b1735c6a5436ee9eae095879e",
"params": {
"actionrange":"group", //"group" or "all"
"groupList": [
"aa:bb:cc:dd:ee:f0",
"aa:bb:cc:dd:ee:f1",
"aa:bb:cc:dd:ee:f2"
],
"2.4G":"enable",
"5G_all":"enable",
"5G_high":"enable",
"5G_low":"enable"
}
}
Note: For the four parameters of 2.4G/5G_all/5G_high/5G_low,you only need to send the parameters
which you want to set, and don't need to send them all.

Request Parameters:
params type validation description

If the actionrange is group, the ap's radio will be


actionrange enum group/all enabled/disabled in the group. If the actionrange is all,
the ap's radio will be enabled/disabled in all aps.

Valid apmac If the actionrange is group, the groupList need to be


groupList array
list filled. If not, it does not need to be filled.

Enables or disables the 2.4g radio of the AP. This


2.4G enum enable/disable
parameter is valid for all AP models.

Enables or disables the 5g radio of the AP. This


5G_all enum enable/disable parameter is valid for other AP models except
AP1231/AP1232.

Enables or disables the 5g high frequency radio of the


5G_high enum enable/disable AP. This parameter is only valid for AP1231/AP1232
models.

Enables or disables the 5g low frequency radio of the


5G_low enum enable/disable AP. This parameter is only valid for AP1231/AP1232
models.

Response:

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "true/false",
"message": "No id/No method/Invalid session/No params/Ubus lookup id failed/Ubus call
nbm failed, status = xxx/Failed to get nbm return value/Please access pvc/The parameter is
wrong: xxx/Mqtt pub fail/Mqtt timeout/RF return error/Set radio fail/Set radio success"
}
}

Return Values:

result type description

If the interface is called successfully, this parameter is true.If the interface fails
success string
to call, this parameter is false.

message string Return the result information of the call.

6. download object
For the download object, provide one method: download.snapshotLog.

download.snapshotLog

Description:

Collect logs of an AP.


Which AP is collected, directly access that AP through the username & password.

Request:

{
"id": 1,
"jsonrpc": "2.0",
"method": "download.snapshotLog",
"params": {
"username":"Administrator",
"password":"21232f297a57a5a743894a0e4a801fc3"
}
}
Note: Only use the Administrator account to log in.

Request Parameters:

params type description

username string The username is Administrator.

The default password is 21232f297a57a5a743894a0e4a801fc3. This is the


password string
md5 hash of “admin”.

Response:

Note:
If the interface fails to call,the following error reason will be returned;
If the interface is called successfully, it will directly return the log compressed package.
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"success": "false",
"message": "No id/No method/No params/No username/No password/The username is not
Administrator/Password wrong/Collection log failed/Collection log timeout/Open path:xxx failed"
}
}

Return Values:
result type description

success string If the interface fails to call, this parameter is false.

message string Return the result information of the call.

You might also like