Ruijie Cloud API Document
update time:2024-08-20
1 Overview
1.1 Purpose
This document describes the modes, processes, methods, and parameters used to
quickly connect third-party platforms to the RUIJIE CLOUD.
This document only provides definitions instead of implementation details of the APIs
used for connection between third-party platforms and the RUIJIE CLOUD.
1.2 Glossary
This document describes Ruijie RUIJIE CLOUD platform.
1.3 Technical Scheme
The RUIJIE CLOUD provides a northbound interface through representational state
transfer (REST), allowing you to use RESTful APIs to develop application programs
based on your specific needs.
REST is an architectural style used for designing and developing network
applications. Compared with Simple Object Access Protocol (SOAP), REST has the
following advantages in Web service implementation:
REST is a lightweight solution without the need to build a standard SOAP
XML as required by SOAP.
REST enables browsers to function as clients to simplify software
requirements.
REST supports caching to improve response speeds.
REST allows different servers to process different requests in a series of
requests based on stateless communication, improving service scalability.
REST has reduced software dependencies compared with SOAP.
REST has enhanced long-term compatibility as software technologies evolve.
The RUIJIE CLOUD supports invocation of RESTful APIs to realize platform
openness and scalable secondary development. Based on HTTP, REST is simple,
lightweight, and highly effective. You can use a browser to invoke REST.
1.4 API Implementation Process
Figure 1‑1 API Implementation Process
The API implementation process consists of user login, token acquisition, RESTful
API invocation, token re-application, and RESTful API re-invocation.
A user logs in to the RUIJIE CLOUD and performs authentication in order to
use a third-party application. If the user identity is valid, the RUIJIE CLOUD
returns an access_token to the third-party application. Note: All users are
managed on the RUIJIE CLOUD, which authenticates users who want to use
third-party applications. The access_token is the credential for RESTful API
invocation and must be carried in every RESTful API invocation request. For
details, see the section about how to use the access_token to apply for
RESTful APIs.
The access_token allows the third-party application to invoke RESTful APIs to
complete service processing.
The expiration time of the access_token is 30 minutes, after which the
access_token will expire and a new one must be applied for again.
The third-party application needs to check the code value returned by each
RESTful API. If the code value is 4 , the access_token has expired.
In this case, the third-party application needs to apply for a new access_token
in order to resume RESTful API invocation.
The default expiration time for the token is 30 minutes. The token expires if it
is neither used for access within 30 minutes. The expired token cannot be
used for access but it can be updated. The expiration time (30 minutes) starts
from the last access or update.
1.5 Uniform Specifications
1.5.1 Message Encapsulation Specifications
A uniform character set is used. All packets transferred during RESTful API
invocation are encoded using UTF-8.
All external RESTful APIs provided by the RUIJIE CLOUD adopt the uniform
URI prefix http://ip:port/service/api/ for the moment. If the domain name format
is used, the content of ip corresponds to the domain name. The uniform URI
prefix is represented by [ApiUrlPrefix] in the following.
API requests can be committed using the GET, POST, DELETE, and PUT
methods.
Parameter formats: Request parameters are classified into JsonParam ,
PathParam , and QueryParam.
JsonParam is carried in the message body of an HTTP request. The
packet content is in the JSON format.
That is, the Content-Type field of the HTTP header is set to
application/json.
The following shows an example of the JSON format:
{“A”:value_a,“B”:value_b}
The names of the elements ( A and B ) indicate the parameter names
and the values ( value_a and value_b ) of the elements indicate the
parameter values.
PathParam is located in the path of a URI and separated by slashes (/).
For example, a URI path is defined as follows:
http://172.18.34.136/service /api/group/{groupId}
In the request URL http://172.18.34.136/service//macc/api/group/2, the
value of groupId is 2.
QueryParam is located after the absolute path of a URI. It starts with a
question mark (?) and adopts the format of parameter
name=parameter value. Parameters are separated by the “&” symbol
but are not ordered. The following is a URI that contains the
QueryParam parameter in the parameter name=parameter value
format:
http://172.18.34.136/service/api/login?appid=0001&account=admin&pa
ssword=admin
The values of the account and password parameters are both admin.
For RESTful APIs, the HTTP message body is in the format of
application/json. That is, the Content-Type field of the HTTP header is set to
application/json.
Return codes:
If the 200 status code is returned, the requested operation is
successful.
If any other status code is returned, a network exception or other
unknown exceptions occur.
1.5.2 RESTful API QueryParam Specifications
The following table lists the requirements for the QueryParam parameter carried in
all RESTful APIs.
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
For example:
http://Serverip/service/api/maint/devices?access_token=A002B4E1E91747E0A1E56
9E2CB8EE07C
1.5.3 RESTful API Response Parameter Specifications
The following table lists the response parameters applicable to all RESTful APIs.
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is null or is not carried.
1.6 Request Flow Demo
The below image is the request flow demo of creating NEW Voucher, help you
understand API request.
2 RUIJIE CLOUD APIs
2.1 Authorization Management APIs
The URI prefix [CloudUrlPrefix] is cloud accessing address, such as
https://cloud-as.ruijienetworks.com.
2.1.1 Get an Access Token
Descripti Get an Access Token
on
Implemen RUIJIE CLOUD
ter
URL [CloudUriPrefix]/service/api/oauth20/client/access_token?token=d6
3dss0a81e4415a889ac5b78fsc904a
Request POST
Method
QueryParam request parameters:
Parameter Ty Manda Description
Name pe tory
token Str M This value is
ing d63dss0a81e4415a889ac5b78fsc904a, no need
change this value.
Body JsonParam request parameters:
Parameter Typ Mandato Description
Name e ry
appid Stri M Application ID, Get from Ruijie Cloud
ng Backend
secret Stri M Application Secret, Get from Ruijie
ng Cloud Backend
Returned parameters:
Paramet Ty Manda Description
er Name pe tory
code int M General return value. 0: operation succeeded
Non-0: operation failed
msg Str O Code description.
ing
accessTo Str M Token assigned by the RUIJIE CLOUD. Use this
ken ing accessToken to call API. By default, the token
expiration time is 60 minutes.
Request example:
POST
https://{{cloudserver}}/service/api/oauth20/client/access_token?token=d63dss0
a81e4415a889ac5b78fsc904a
--header "Content-Type: application/json"
--data "{
"appid": "Tartestxxxxx",
"secret": "Dartestxxxxx"
}"
Response message example:
{
"code": 0,
"msg": "OK.",
"accessToken": "jJVmxTfIVok7D0ol5z9Q6oCMkHJPEERl"
}
2.1.2 Refreshing a Token
Description Refreshes a token.
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/service/api/token/refresh?appid={}&secret={}&a
ccess_token={}
Request GET
Method
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
appid Str M Application corresponding to the specified app ID,
ing which is assigned by the server.
secret Str M Key corresponding to the specified app ID, which
ing is assigned by the server.
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M General return value. 0: operation succeeded
Non-0: operation failed
msg Str O Code description.
ing
accessToke Str O New Token assigned by the RUIJIE CLOUD.
n ing
Request example:
Get
https://cloudServer.ruijienetworks.com/service/api/token/refresh?appid=xxx2&s
ecret=11xxxxx1&access\_token=C1EF2AE38BD04A5CB83D4D8CB5DF374E
Response message example:
{
"code": 0,
"msg": "OK.",
"accessToken": "C1EF2AE38BD04A5CB83D4D8CB5DF374E"
}
2.2 Network Groups API
2.2.1 Get Network Group List
Descrip Get Network Group List, if your network group tree has
tion Location, Building and Sub-group, these group tree hierarchical
structure will be responsed
Impleme RUIJIE CLOUD
nter
URL [CloudUrlPrefix]/service/api/group/single/tree?depth=BUILDING&acc
ess_token=JveZb3FJvRLiLZDog7B0oC5x9n6opWTr
Request GET
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M The token to call Ruijie Cloud API. An
oken ing access_token is gotten from 2.1.1.
depth Str M LOCATIOIN, BUILDING, DEVICE. LOCATION:
ing return only logical location type of groups.
BUILDING: return including project type of
groups. DEVICE: return including subgroups of
project
Returned parameters:
Paramet Ty Manda Description
er Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
groups list M Network groups list
name Str M Network group name
ing
timezone Str M Network timezon
ing
groupId int M Network Group ID, Create Voucher based on this
GroupID, each customers can be seen as one
network (Group)
type Str M LOCATION, BUILDING, DEVICE
ing
subGroup list O Subgroups of current group
s
Request message example:
curl --request GET
"https://{{cloudserver}}/service/api/group/single/tree?depth=BUILDING&access_
token=JveZb3FJvRLiLZDog7B0oC5x9n6opWTr"
--header "Content-Type: application/json" \
--data "{
}"
Response message example:
{
"code": 0,
"msg": "OK.",
"groups": {
"name": "dumy",
"timezone": "Asia/Shanghai",
"groupId": 0,
"subGroups": [
{
"name": "ProjectSDDD",
"description": "",
"timezone": "Asia/Shanghai",
"groupId": 12480,
"createTime": "2017-12-26 14:21:26",
"type": "LOCATION",
"businessType": "MARKET",
"subGroups": [
{
"name": "HomeDDA",
"description": "",
"timezone": "PRC",
"groupId": 12482,
"createTime": "2017-12-26 14:21:55",
"type": "BUILDING",
"businessType": "UNCERTAIN",
"sceneEnum": "UNCERTAIN"
}
],
"sceneEnum": "COMMON"
},
{
"name": "Hotel225",
"description": "",
"timezone": "Asia/Shanghai",
"groupId": 12479,
"createTime": "2017-12-26 14:21:11",
"type": "LOCATION",
"businessType": "MARKET",
"subGroups": [
{
"name": "BeijingRoad001",
"description": "",
"timezone": "Asia/Shanghai",
"groupId": 12484,
"createTime": "2017-12-26 14:22:17",
"type": "LOCATION",
"businessType": "MARKET",
"subGroups": [],
"sceneEnum": "COMMON"
},
{
"name": "ZhongShan330",
"description": "",
"timezone": "Asia/Shanghai",
"groupId": 12485,
"createTime": "2017-12-26 14:22:28",
"type": "LOCATION",
"businessType": "MARKET",
"subGroups": [],
"sceneEnum": "COMMON"
}
],
"sceneEnum": "COMMON"
}
]
},
"rootGroupName": "dumy",
"rootGroupId": 0
}
2.3 Voucher Management APIs
2.3.1 Get User Group List (New)
Descripti Get User Group List
on
Impleme RUIJIE CLOUD
nter
URL [CloudUrlPrefix]/service/api/intl/usergroup/list/{group_Id}?pageIndex
={start}&pageSize={pageSize}&access_token={}
Request GET
Method
PathParam request parameters:
Parameter Typ Manda Description
Name e tory
groupId Inte M Group ID, network group Id, get from API “Get
ger Network Group List”
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
pageInd Int M Begin index of the record, start with 0. For
ex example, PageSize=10, to get Second page, the
start is (2-1)*PageSize =10
pageSiz Int M Page Size for paging record items return, if u want
e to get all profiles, u can set start=0,
pageSize=1000 (if profiles num <1000).
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
count int Package Number
data
id Int M UserGroup ID
userGroupN Str M User group Name
ame ing
authProfileI Int M Group policy profile id
d
createTime Int M Timestamp of create time
quota Int M Each Voucher Traffic Volume Limit (MB), 0
means no limited.
downloadR Int M Client Download Speed Limit, 0 means no
ateLimit limited.
uploadRate Int M Client Upload Speed Limit, 0 means no limited.
Limit
description Str M description of the package
ing
bindMac Int M Whether enable bind MAC for online login
Voucher code, 1 means Bound, 0 means no
Bound.
noOfDevice Int M Current user number
Request message example:
GET
https://{{server}}/service/api/intl/usergroup/list/449441?pageIndex=0&pageSiz
e=20&access\_token=tGdm3muWyoT0oM5S9B6oTaKTOISnJV9p
Response message example:
{
"code": 0,
"msg": "OK.",
"data": [
{
"id": 18067,
"userGroupName": "StaffGroup",
"authProfileId": "30113648274480073538014045592098",
"createTime": 1662042491000,
"updateTime": 1662042491000,
"name": "StaffGroup",
"noOfDevice": 3,
"bindMac": 0,
"timePeriod": 30,
"quota": 100.0,
"downloadRateLimit": 0,
"uploadRateLimit": 0,
"packageType": "COMMON"
},
{
"id": 18066,
"userGroupName": "BossGroup",
"authProfileId": "23999504999216992345230097272894",
"createTime": 1662042483000,
"updateTime": 1662042506000,
"name": "BossGroup",
"noOfDevice": 3,
"bindMac": 0,
"timePeriod": 30,
"quota": 0.0,
"downloadRateLimit": 5120,
"uploadRateLimit": 5120,
"packageType": "COMMON"
}
],
"count": 2,
"maxAllowNum": 20
}
2.3.2 Generate Voucher (New)
Descript Generate and return Voucher codes list
ion
Impleme RUIJIE CLOUD
nter
URL [CloudUrlPrefix]/service/api/intlSamVoucher/create/{tenantName}/{u
serName}/{groupId}?access_token={}
Request POST
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
tenantName String M Tenant
Name
userName String M User Name
groupId Integer M Group ID.
QueryParam parameters::
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
JsonParam parameters::
Parameter Ty Manda Description
Name pe tory
quantity Int M Voucher created number, Must <= 100.
profile Str M Profile package UUID, get from API “2.3.1 Get
ing User Group List” of authprofileid field
userGroup int M User Group Id, get from API “2.3.1 Get User
Id Group List” of id field
firstName Str Option User first name
ing al
lastName Str Option User last name
ing al
email Str Option User email address
ing al
phone Str Option User phone number
ing al
comment Str Option This is user/voucher alias
ing al
Returned parameters::
Paramet Ty Manda Description
er Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful, this
ing parameter is not carried.
count Int M Voucher total number
list
uuid Str M Voucher UUID
ing
codeNo Str M Voucher Code
ing
status Str M Voucher status 1: unused 2: in-use status 3:
ing expired
profileId Str M Voucher Profile package id
ing
expiryTim Str M Voucher expiry date, timestamp (from 1970-1-1
e ing timestamp milliseconds), expiry date is counted
begin from activated time.
limitClient Int M The number of concurrent clients to use voucher
s code
Request message example:
curl --request POST
https://{{server}}/service/api/intlSamVoucher/create/664505441@qq.com/6645054
41@qq.com/449441?access\_token=tGdm3muWyoT0oM5S9B6oTaKTOISnJV9p
--header "Content-Type: application/json" \
--data "{
"quantity": 2,
"profile":"30113648274480073538014045592098",
"userGroupId":18067,
"firstName":"test1",
"lastName":"william",
"email":"test@gmail.com",
"phone": "21025522",
"comment": "alias1"
}"
Response message example:
{
"code": 0,
"msg": "Success.",
"voucherData": {
"code": 0,
"msg": "OK.",
"count": 2,
"list": [
{
"uuid": "78eb665b70d44658937db776905676c9",
"codeNo": "4zr45r",
"status": "1",
"tenantId": "nSgKPhYFDQPfdECFLckTUlBoJVpqFvlI",
"secuserId": "",
"totle": 0,
"sign": "",
"profileId": "30113648274480073538014045592098",
"expiryTime": "2121-09-01 22:48:10",
"limitClients": 3,
"qrcodeUrl": "www.ruijienetworks.com",
"groupId": "1be31cf89904484d8b90fe1784261c06",
"firstName": "test1",
"lastName": "william",
"email": "test@gmail.com",
"phone": "21025522",
"comment": "alias1"
},
{
"uuid": "5e80c4cc86684a509005c90007dfdd02",
"codeNo": "gfkhrw",
"status": "1",
"tenantId": "nSgKPhYFDQPfdECFLckTUlBoJVpqFvlI",
"secuserId": "",
"totle": 0,
"sign": "",
"profileId": "30113648274480073538014045592098",
"expiryTime": "2121-09-01 22:48:10",
"limitClients": 3,
"qrcodeUrl": "www.ruijienetworks.com",
"groupId": "1be31cf89904484d8b90fe1784261c06",
"firstName": "test1",
"lastName": "william",
"email": "test@gmail.com",
"phone": "21025522",
"comment": "alias1"
}
]
}
}
2.3.3 Receive Customized Voucher
This way the voucher code can be generate from external system. The code format
must be xxxx-xxxx, xxxx-xxxx-xxxx. And the code must be unique under the tenant,
otherwise it will fail to add.
Descrip Receive Voucher Code from external system.
tion
Implem RUIJIE CLOUD
enter
URL [CloudUrlPrefix]/service/api/intlSamVoucher/create/{tenantName}/{us
erName}/{groupId}/{code}?access_token={}&tenantId={}
Reques POST
t
Method
PathParam request parameters:
Parameter Typ Mandat Description
Name e ory
tenantName Stri M Tenant Name
ng
userName Stri M User Name
ng
groupId Inte M Group ID.
ger
code Stri M Customize Voucher Code, format:
ng xxxx-xxxx, xxxx-xxxx-xxxx.
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
JsonParam request parameters:
Parameter Ty Manda Description
Name pe tory
groupId Str M Network Group ID, get from API “2.2.1 Get
ing Network Group List”
profile Str M Profile package UUID, get from API “2.3.1 Get
ing Voucher Package List”
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
Request message example:
curl --request POST
https://Server.ruijienetworks.com/service/api/intlSamVoucher/create/beijingru
ijie/ruijie\_demo/1789/1234-5678?access\_token=C0116BF86B66497C9B5733B15240ED
A3&tenantId=209
--header "Content-Type: application/json" \
--data "{
"groupId":"1789",
"profile":"66693400473348729256354243919059 "
}"
Response message example:
{
"code": 0,
"msg": "OK.",
}
2.3.4 Query Voucher List
Descrip Query created voucher list
tion
Impleme RUIJIE CLOUD
nter
URL [CloudUrlPrefix]/service/api/intlSamVoucher/getList/{tenantName}/{g
roupId}?access_token={}&tenantId={}&start={}&pageSize={}
Request GET
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
tenantName String M Tenant
Name
groupId Integer M Group ID.
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Str M Tenant ID
ing
start Int M Begin index of the record, start with 0. For
example, PageSize=10, to get Second page, the
start is (2-1)*PageSize =10
pageSiz int M Page Size for paging return
e
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
count Int M Voucher total number
list
uuid Str M Voucher UUID
ing
codeNo Str M Voucher Code
ing
status Str M Voucher status 1: unused 2: in-use status 3:
ing expired
profileId Str M Voucher Profile package id
ing
expiryTime Str M Voucher expiry date, timestamp (from 1970-1-1
ing timestamp milliseconds)
limitClients Int M The number of concurrent clients to use
voucher code
Request message example:
curl --request GET
https:/CloudIP/service/api/intlSamVoucher/getList/beijingruijie/1789?access\_
token=3ABBEE24339F49AE9A819D955216EECA&start=11&pageSize=10&tenantId=184
Response message example:
{
"code": 0,
"msg": "OK.",
"voucherData": {
"code": 0,
"msg": "OK.",
"count": 13,
"list": [
{
"uuid": "3c36bc35f3444394bc0fda39a3a62225",
"tenantId": "KeIHfvZpxsOBpLUdyBrBJZRTlQzhVYFT",
"voucherCode": "pgnazc",
"nameRef": "",
"timePeriod": 10080,
"usedTime": 0,
"createTime": 1531122413000,
"maxClients": 2,
"currentClients": 0,
"quota": 200,
"usedQuota": 0,
"status": "1",
"qrcodeUrl": "www.ruijienetworks.com",
"downloadRateLimit": 0,
"uploadRateLimit": 0,
"bindMac": 0,
"packageName": "7DayWiFi"
},
{
"uuid": "93a88786c5d44d8689fd634bf550ea11",
"tenantId": "KeIHfvZpxsOBpLUdyBrBJZRTlQzhVYFT",
"voucherCode": "h3mtkr",
"nameRef": "Room403 Chan Tai Man",
"timePeriod": 1440,
"usedTime": 0,
"createTime": 1531122313000,
"maxClients": 3,
"currentClients": 0,
"quota": 100,
"usedQuota": 0,
"status": "1",
"qrcodeUrl": "www.ruijienetworks.com",
"downloadRateLimit": 0,
"uploadRateLimit": 0,
"bindMac": 0,
"packageName": "1DayWiFi"
}
]
}
}
2.4 Auth Account Management APIs
2.4.1 Get User Group List (New)
Refer to 2.3.1 section. We can create user group on cloud first, then call 2.3.1 API to
get user group list.
2.4.2 Auth Account Management
2.4.2.1 Account Add
Descrip Authentication Account Add
tion
Implem RUIJIE CLOUD
enter
URL [CloudUrlPrefix]/service/api/samTransfer/account/create/{tenantNam
e}/{userName}/{groupId}?access_token={}&tenantId={}
Request POST
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
tenantName String M Tenant
Name
groupId Integer M Group ID.
userName String M Account
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Str M Tenant ID
ing
jsonParam request parameters:
Parameter Type Mandator Description
Name y
username String M Account name
password String M Account password
profileId String M Package Id
userGroupId String M User Group ID, get from 2.3.1
section
vpnEnable Boolea M True or false
n
comment Double O Alias name
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
Request message example:
curl --request POST
https://Server.ruijienetworks.com/service/api/samTransfer/account/create/test
demo/testdemo/927?access\_token=F8BF266ED6D84B119D98D21EC83E8AD6&ishttps=fals
e&tenantId=2756
--header "Content-Type: application/json" \
--data "{
"username": "test\_account\_name",
"password": "123456",
"profileId": "87984554683924718561245367586213",
"userGroupId":20990,
"vpnEnable":false,
"comment": "alias name"
}"
Response message example:
{
"code": 0,
"msg": "OK."
}
2.4.2.2 Account Delete
Descripti Account Delete
on
Implemen RUIJIE CLOUD
ter
URL [CloudUrlPrefix]/service/api/samTransfer/account/delete/{groupId}?
access_token={}&tenantId={}&ishttps={}
Request POST
Method
PathParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Str M Tenant ID
ing
groupId Int M Project ID, get from 2.2.1
ishttps Str O If use https valid: true false
ing
jsonParam request parameters:
Parameter Name Type Mandatory Description
uuids String[] M Account UUID
Array
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
Request message example:
curl --request POST
http://Server.ruijienetworks.com/service/api/samTransfer/account/delete/5678?
access\_token=F8BF266ED6D84B119D98D21EC83E8AD6&ishttps=false&tenantId=2756
--header "Content-Type: application/json" \
--data "[
"00fdaabc88c4416a875f0db8162264a0",
"029a870d49ff452783844deb476a4ecf",
"0487773ad60947d7956e5e738a8438cc"
]"
Response message example:
{
"code": 0,
"msg": "OK."
}
2.4.2.3 Get Account (singel User info)
Use 2.4.2.4 QueryParam : name= ***** (filter by name)
2.4.2.4 Get all Accounts (by date, by plan)
Descrip Account Get all
tion
Implem RUIJIE CLOUD
enter
URL [CloudUrlPrefix]/service/api/samTransfer/account/getList/{tenantNam
e}/{groupId}?access_token={}&tenantId={}&ishttps={}&start={}&page
Size={}&name={}&createBegin={}&createEnd={}
Reques GET
t
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
tenantName String M Tenant
Name
groupId Integer M Group ID.
QueryParam request parameters:
Paramet Typ Manda Description
er Name e tory
access_t Stri M An access_token is assigned by server to client.
oken ng When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Stri M Tenant ID
ng
ishttps Stri O If use https valid: true false
ng
start Stri O Start page
ng
pageSiz Stri O Per page size
e ng
createE Stri O
nd ng
createB Stri O
egin ng
status Stri O 1: not Actived; 2: Actived; 3: Expired;
ng
name Stri O Account name for searching
ng
usedQu Inte Y Unit is MB
ota ` ger
Request message example:
curl --request GET
http://Server.ruijienetworks.com/service/api/samTransfer/account/getList/{ten
antName}/{groupId}?access\_token=F8BF266ED6D84B119D98D21EC83E8AD6&ishttps=fal
se&tenantId=2756
&start=0&pageSize=10&name=aaa&createBegin=15235422&createEnd=4851325
Response message example:
{
"code": 0,
"msg": "OK.",
"count": 2,
"list": [
{
"uuid": "912e12380275461b9757ce9dd0ddd053",
"refName": "alias name",
"username": "test\_account\_name\_02",
"password": "123456",
"createTime": 1604307006000,
"expiryTime": null,
"logintime": null,
"groupId": "84ea43d8230042ea8855344e5c0a3f9f",
"tenantId": "ZxOKzqQmNrgNbCeHSHPllOUDqCoHSECZ",
"profileId": "14251152229359204590000804102161",
"profileName": "4233423",
"status": "1",
"quotalimit": 100,
"usedQuota": 0,
"maxUplink": 0,
"maxDownlink": 0,
"timePeriod": 30,
"currentClients": 0,
"maxClients": 3,
"usedTime": null
},
{
"uuid": "85e5270efca840e8bc9551cd9230650d",
"refName": "alias name",
"username": "test\_account\_name",
"password": "123456",
"createTime": 1604307001000,
"expiryTime": null,
"logintime": null,
"groupId": "84ea43d8230042ea8855344e5c0a3f9f",
"tenantId": "ZxOKzqQmNrgNbCeHSHPllOUDqCoHSECZ",
"profileId": "14251152229359204590000804102161",
"profileName": "4233423",
"status": "1",
"quotalimit": 100,
"usedQuota": 0,
"maxUplink": 0,
"maxDownlink": 0,
"timePeriod": 30,
"currentClients": 0,
"maxClients": 3,
"usedTime": null
}
]
}
2.4.2.5 Update account
Descripti Account Update
on
Implement RUIJIE CLOUD
er
URL [CloudUrlPrefix]/service/api/samTransfer/account/update?access_t
oken={}&tenantId={}&ishttps={}
Request POST
Method
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Str M Tenant ID
ing
ishttps Str O If use https valid: true false
ing
jsonParam request parameters:
Parameter Name Type Mandatory Description
uuid String M Account uuid
password String M Account
password
refName Double O Alias name
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
Request message example:
curl --request POST
http://Server.ruijienetworks.com/service/api/samTransfer/account/update?acces
s\_token=F8BF266ED6D84B119D98D21EC83E8AD6&ishttps=false&tenantId=2756
--header "Content-Type: application/json" \
--data "{
"uuid": "5c9c6d7560db4132adbd1888641d0239",
"password": "123456",
"refName": "alias name"
}"
Response message example:
{
"code": 0,
"msg": "OK."
}
2.4.2.6 Get active User list
Use 2.4.2.4 QueryParam :status = 2 (filter by status)
2.4.2.7 Renew User
Descripti Account Renew
on
Implement RUIJIE CLOUD
er
URL [CloudUrlPrefix]/service/api/samTransfer/account/reset?access_to
ken={}&tenantId={}&ishttps={}
Request POST
Method
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Str M Tenant ID
ing
ishttps Str O If use https valid: true false
ing
jsonParam request parameters:
Parameter Name Type Mandatory Description
uuids String[] M Account uuids
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
Request message example:
curl --request POST
http://Server.ruijienetworks.com/service/api/samTransfer/account/reset?access
\_token=F8BF266ED6D84B119D98D21EC83E8AD6&ishttps=false&tenantId=2756
--header "Content-Type: application/json" \
--data "[
"5c9c6d7560db4132adbd1888641d0239",
"5c9c6d7560db4132adbd1888641d0323"
]"
Response message example:
{
"code": 0,
"msg": "OK."
}
2.4.3 Account Dashboard Statistic
2.4.3.1 GET all account information
Descrip Get all authentication count information 1. Total User 2. Valid
tion User 3. Expired User
Implem RUIJIE CLOUD
enter
URL [CloudUrlPrefix]/service/api/samTransfer/account/getStatusSummary
/{tenantName}/{groupId}?access_token={}&tenantId={}&ishttps={}
Reques GET
t
Method
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
tenantId Str M Tenant ID
ing
ishttps Str O If use https valid: true false
ing
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
total Str Account total number
ing
used Str User Account number
ing
expired Str Expired Account number
ing
Request message example:
curl --request GET
http://Server.ruijienetworks.com/service/api/samTransfer/account/getStatusSum
mary/testdemo/143?access\_token=F8BF266ED6D84B119D98D21EC83E8AD6&ishttps=fals
e&tenantId=2756
Response message example:
{
"code": 0,
"msg": "OK.",
"total": 2,
"used": 0,
"expired": 0
}
2.5 Client Record APIs
2.5.1 Client Online/ Offline history
Description Get Online or offline history client record list
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/logbizagent/logbiz/api/sta/sta_users?access_t
oken={}
Request POST
Method
QueryParam request parameters:
Param Ty Manda Description
eter pe tory
access Str M An access_token is assigned by server to client.
_token ing When the client invokes a RESTful API, it needs to
return the access_token as it is to the server. The
access_token expires after its expiration time has
elapsed, and the client needs to apply for a new
one in order to resume API invocation.
JsonParam request parameters:
Param Ty Manda Description
eter pe tory
groupI int M Network Group ID, get from API “2.2.1 Get Network
d Group List”
pageSi int M Page Size for paging return
ze
pageIn int M Begin index of the record, start with 0. For example,
dex PageSize=10, to get Second page, the start is
(2-1)*PageSize =10
staTyp Str M “currentUser”: Current online
e ing data;“onofflineUserHistory": History data
mac Str O Matching client mac address
ing
ssid Str O Matching client link wireless ssid
ing
mac Str O Matching client link serial_number
ing
Returned parameters:
co int M Response code. For details, see the section about
de response code description.
ms Stri O Code message. If the operation is successful, this parameter
g ng is not carried.
Request message example:
curl --request POST
https://Server.ruijienetworks.com/logbizagent/logbiz/api/sta/sta_users?access
_token=x9oI0oP1E8b8r9J2oawukhdbU2iGzqGk
--header "Content-Type: application/json" \
--data " {
"pageSize": 10,
"pageIndex": 1,
"staType": "onofflineUserHistory",
"groupId": 160312
}"
Response message example:
{
"code": 0,
"msg": "OK.",
"list": [{
"activeTime": 5353000,
"band": "2.4G",
"buildingId": 9391115,
"buildingName": "GeneralDemo2",
"channel": "1",
"deviceAliasName": "Ruijie",
"downlinkRate": 8222548.0,
"floorNoise": -74,
"mac": "ff61.f313.0101",
"onlineTime": 1716804247000,
"pktLoseRate": 0,
"rssi": "-67",
"rssiInt": -67,
"score": 27,
"scoreReason": "heavy interference",
"sn": "NAHK0046H0008",
"ssid": "NAHK0046H0008",
"timeDelay": 64,
"updateTime": 1716809600376,
"uplinkRate": 1538630.0,
"userIp": "192.168.110.11",
"utilization": 28,
"wifiDown": 990833347,
"wifiUp": 998323450,
"wifiUpDown": 1989156797
}],
"count": 1
}
2.6 Device Management APIs
2.6.1 Device List
2.6.1.1 AP / Switch List
Description Get AP / Switch list
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/service/api/maint/devices?access_token={
}
Request Method GET
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
product_t Str O Product series type,e.g. “EAP, RAP, AP, EGW”,
ype ing but this type is backend series type, not the same
as product model name shown. Recommend to
use belowcommon_type to call this API.
common Str M Product type,e.g. AP, Switch, Gateway
_type ing
group_id int M Group ID
key Str O Search key, e.g. AP SN or Alias
ing
page int M Begin index of the record, start with 0. For
example, PageSize=10, to get Second page, the
start is (2-1)*PageSize =10
per_page int M Page Size for paging return
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
Request message example:
Get
https://Server.ruijienetworks.com/service/api/maint/devices?page=1&per\_page=
10&group\_id=57805&product\_type=AP&access\_token=x9oI0oP1E8b8r9J2oawukhdbU2i
GzqGk
Response message example:
{
"code": 0,
"msg": "OK.",
"deviceList": [
{
"serialNumber": "G1LQ68P016011",
"productClass": "AP720-I",
"productType": "AP",
"hardwareVersion": "1.00",
"softwareVersion": "AP\_RGOS 11.1(9)B1P19, Release(06200910)",
"onlineStatus": "ON",
"offlineReason": "INFORM",
"name": "",
"aliasName": "",
"groupId": 154845,
"groupName": "Binnykuoll",
"timezone": "Etc/GMT-8",
"parentGroupName": "1653454930@qq.com",
"remark": "",
"localIp": "192.168.110.60",
"cpeIp": "220.250.41.86",
"lastOnline": 1626838447000,
"createTime": 1623312353000,
"mac": "5869.6ce9.100e",
"confSyncType": "UP\_TO\_DATE",
"confSyncTypeDesc": "UP\_TO\_DATE",
"apModeChange": "IDLE",
"apMode": "FAT",
"devMode": "",
"commonType": "AP"
}, {
"serialNumber": "G1MQAWQ00077C",
"productClass": "RG-AP840-I",
"productType": "AP",
"hardwareVersion": "1.00",
"softwareVersion": "AP\_RGOS 11.9(6)B1, Release(07201411)",
"onlineStatus": "OFF",
"offlineReason": "INFORM",
"name": "Ruijie1618281901637",
"aliasName": "Ruijie1618281901637",
"groupId": 126115,
"groupName": "tests",
"timezone": "Asia/Shanghai",
"parentGroupName": "1653454930@qq.com",
"remark": "Ruijie\_Auto1618281901637",
"localIp": "192.168.110.195",
"cpeIp": "192.168.110.195",
"lastOnline": 1618295587000,
"createTime": 1617243656000,
"mac": "0074.9cbd.ac9e",
"confSyncType": "NOT\_SYNC",
"confSyncTypeDesc": "NOT\_SYNC",
"apModeChange": "IDLE",
"apMode": "FAT",
"devMode": "",
"commonType": "AP"
}
],
"totalCount": 2
}
2.6.2 Get Device Flow Trend For Last 24 Hours
Description Query Reyee EG Flow Trend List For Last 24 Hours
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/logbizagent/logbiz/api/flow/show/hour?access_
token={}
Request POST
Method
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
jsonParam request parameters:
Parameter Name Type Mandatory Description
sn Strin M The device serial number
g
startDate Date M Query start time, timestamp
format
endDate Date M Query end time, timestamp format
Returned parameters::
Paramet Ty Manda Description
er Name pe tory
code int M Response code. For details, see the section about
response code description.
msg Str O Code message. If the operation is successful, this
ing parameter is not carried.
list
intfType Str M Interface Type
ing
sn Str M The device serial number
ing
buildingI int M Project group id at the Cloud
d
rxBytes Lo M Downlink flow, received Bytes
ng
rxPkts Lo M Number of received packets
ng
txBytes Lo M Uplink flow, transmitted Bytes
ng
txPkts Lo M Number of packets transmitted
ng
timeSta Da M Timestamp (milliseconds from 1970 -1-1) of the
mp te flow value, based on this value transfer to local
TimeZone, such as: 1632339000000, UTC+8 time
is 2021-09-23 03:30:00.
Request message example:
curl --request POST
https://cloudLogBizIP/logbizagent/logbiz/api/flow/show/hour?access\_token?acc
ess\_token=C0116BF86B66497C9B5733B15240EDA3
--header "Content-Type: application/json" \
--data "{
"sn":"H1NA1WA000705",
"startDate": 1632313892000,
"endDate": 1632468666882
}"
Response message example:
{
"code": 0,
"msg": "OK.",
"count": 2,
"list": [
{
"buildingId": 58959,
"rxBytes": 297421,
"rxPkts": 1592,
"txBytes": 297964,
"txPkts": 1498,
"timeString": "2021-09-23 03:30:00",
"timeStamp": 1632339000000
},
{
"buildingId": 58959,
"rxBytes": 167569,
"rxPkts": 1307,
"txBytes": 202703,
"txPkts": 1166,
"timeString": "2021-09-23 03:40:00",
"timeStamp": 1632339600000,
"egRxBytes": 0,
"rxRate": 0.002,
"txRate": 0.003
} ]
}
}
2.6.3 Get Device ON/OFF status
Description Get Device On/Off status
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/service/api/device/
{sn}?access_token={}
Request Method GET
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
PathParam request parameters:
Parameter Name Type Mandatory Description
sn String M The device serial
number
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
groupId Int M Network Group Id
productCla Str M The device product class
ss ing
onlineStatu Str M The device online status, including ON, OFF,
s ing NEVER_ONLINE
mac Str M The device mac address
ing
serialNumb Str M The device serial number
er ing
name Str M User defined alias
ing
Request message example:
curl --request GET
https:/CloudIP/service/api/device/MACC942570020?access\_token=3hCeDNEVVbcz4go
g0ou4J7A7W3z0ok2S
Response message example:
{
"code": 0,
"msg": "OK.",
"groupId": 189279,
"localIp": "192.168.200.4",
"productClass": "EG205G-V2",
"productType": "EGW",
"softwareVersion": "ReyeeOS
1.53.1621;EG\_3.0(1)B11P53,Release(08162123)",
"onlineStatus": "ON",
"cpeUrl": "",
"hardwareVersion": "1.00",
"osType": "openwrt\_1.0",
"remark": "",
"mac": "00d0.f815.0843",
"serialNumber": "MACC942570020",
"name": "Gateway"
}
2.6.4 Get Gateway Port status
Description Query Gateway Device ON/OFF status
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/service/api/gateway/intf/info/{sn}?access_tok
en={}
Request GET
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
sn String M The device serial
number
Returned parameters::
Parameter Typ Manda Description
Name e tory
code int M Response code. For details, see the section
about response code description.
msg Strin O Code message. If the operation is successful,
g this parameter is not carried.
list
linestatus Bool M True / false, true means cable inserted and
ean port ON status.
adminstatu Bool M True / false, true means enable administration
s ean of port.
alias Strin M Alias name
g
type Strin M Port Type. E.g. LAN
g
sn Strin M The device serial number
g
speed Strin M Speed rate
g
pppoe Strin M Is pppoe port
g
layer2Nam Strin O Layer 2 interface name
e g
port int M Port number
Request message example:
curl --request GET
https:/CloudIP/service/api/service/api/gateway/intf/info/H1PT4F2044471?access
\_token=3ABBEE24339F49AE9A819D955216EECA
Response message example:
{
"code": 0,
"msg": "OK.",
"data": [
{
"alias": "Gi0/0",
"sn": "H1NA1WA000705",
"port": 0,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "true",
"description": "",
"ipAddr": "42.200.231.215",
"ipMask": "255.255.255.0",
"type": "WAN",
"nextHop": "42.200.231.254",
"mtu": 1500,
"bandwidth": 1000000,
"downband": 1000000,
"upband": 1000000,
"pppoe": "false",
"speed": "100M",
"mediumType": "copper",
"duplexMode": "Full",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "dhcp",
"province": "Fujian",
"city": "--",
"isp": "xxx",
"poeStatus": "Off",
"enableReversePath": true
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 1,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "false",
"description": "",
"ipAddr": "192.168.110.1",
"iMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2LineStatus": "false",
"layer2Name": "LAN 1",
"poeStatus": "Off",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 2,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "true",
"description": "",
"ipAddr": "192.168.110.1",
"ipMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"speed": "1000M",
"mediumType": "Copper",
"duplexMode": "Full",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2DuplexMode": "Full",
"layer2LineStatus": "true",
"layer2MediumType": "Copper",
"layer2Name": "LAN 2",
"layer2Speed": "1000M",
"poeStatus": "On",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 3,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"lnestatus": "true",
"description": "",
"ipAddr": "192.168.110.1",
"ipMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"speed": "1000M",
"mediumType": "Copper",
"duplexMode": "Full",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2DuplexMode": "Full",
"layer2LineStatus": "true",
"layer2MediumType": "Copper",
"layer2Name": "LAN 3",
"layer2Speed": "1000M",
"poeStatus": "On",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 4,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "true",
"description": "",
"ipAddr": "192.168.110.1",
"ipMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"speed": "1000M",
"mediumType": "Copper",
"duplexMode": "Full",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2DuplexMode": "Full",
"layer2LineStatus": "true",
"layer2MediumType": "Copper",
"layer2Name": "LAN 4",
"layer2Speed": "1000M",
"poeStatus": "On",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 5,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "true",
"description": "",
"ipAddr": "192.168.110.1",
"ipMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"speed": "1000M",
"mediumType": "Copper",
"duplexMode": "Full",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2DuplexMode": "Full",
"layer2LineStatus": "true",
"layer2MediumType": "Copper",
"layer2Name": "LAN 5",
"layer2Speed": "1000M",
"poeStatus": "On",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 6,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "false",
"description": "",
"ipAddr": "192.168.110.1",
"ipMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2LineStatus": "false",
"layer2Name": "LAN 6",
"poeStatus": "Off",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
},
{
"alias": "Gi0/2",
"sn": "H1NA1WA000705",
"port": 7,
"intfType": "Gi",
"hwName": "",
"adminstatus": "true",
"protostatus": "true",
"linestatus": "false",
"description": "",
"ipAddr": "192.168.110.1",
"ipMask": "255.255.254.0",
"type": "LAN",
"mtu": 1500,
"pppoe": "false",
"isSubintf": "false",
"updateTime": 1632468585000,
"ipType": "none",
"layer2LineStatus": "false",
"layer2Name": "LAN 7",
"poeStatus": "Off",
"enableReversePath": false,
"dhcpInfo": {
"id": 44027,
"sn": "H1NA1WA000705",
"name": "ap\_dhcp\_pool",
"ipAddr": "192.168.110.0",
"startIp": "192.168.110.1",
"endIp": "192.168.111.254",
"subnetMask": "255.255.254.0",
"lease": "0 20 0",
"dnsServers": "8.8.8.8 8.8.4.4",
"defaultRouter": "192.168.110.1",
"status": "ENABLE",
"updateTime": 1619091269000,
"ipHelper": "",
"vlanId": "",
"excludedIps": "",
"option43": "3.3.33.3",
"option138": "3.3.33.3",
"ipNum": 510,
"maskLength": 23
}
}
]
}
2.6.5 Get Device Event Log
Description Query Device Event Log by Serial Number
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]
/service/api/apmgt/apinfo/{sn}/devicemgtlogs?access_token={}
Request GET
Method
PathParam request parameters:
Parameter Name Type Mandatory Description
sn String M The device serial
number
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
group_id int M Product details type,e.g. “EAP,.RAP”
days int O Of the last N days
page Int M Page number, if records have many, this API
supports query by paging
per_pag Int M Page Size (return count) by each page
e
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
data
list
sn Str M The device serial number
ing
logtype Str M The device log type, such as ONLINE,
ing OFFLINE, RESTART, etc
logdetail Str M The device log details
ing
operateTim Lo M Timestamp of operation time
e ng
tenantId int M Tenant ID
groupId int M Group ID
accountId int M Fixed to 0, please ignore
Request message example:
curl --request GET
https:/CloudIP/service/api/apmgt/apinfo/
MACC942570020/devicemgtlogs?access\_token=3hCeDNEVVbcz4gog0ou4J7A7W3z0ok2S
Response message example:
{
"code": 0,
"msg": "OK.",
"data": {
"count": 17,
"list": [
{
"id": 9,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67769,
"logType": "reboot",
"logDetail": "Device restart",
"operateTime": 1647829099000,
"accountId": 0
},
{
"id": 10,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67769,
"logType": "onoffline",
"logDetail": "Device online",
"operateTime": 1647829099000,
"accountId": 0
},
{
"id": 373,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67769,
"logType": "onoffline",
"logDetail": "Device offline. The final time when it sends
packets to Cloud is: 2022-03-19 05:00:07(It is an estimated value. The
deviation is 1 minute.)",
"operateTime": 1647644947000,
"accountId": 0
},
{
"id": 198,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "reboot",
"logDetail": "Device restart",
"operateTime": 1647327541000,
"accountId": 0
},
{
"id": 197,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "onoffline",
"logDetail": "Device online",
"operateTime": 1647327541000,
"accountId": 0
},
{
"id": 193,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "onoffline",
"logDetail": "Device offline. The final time when it sends
packets to Cloud is: 2022-03-15 12:35:07(It is an estimated value. The
deviation is 1 minute.)",
"operateTime": 1647326647000,
"accountId": 0
},
{
"id": 183,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "onoffline",
"logDetail": "Device online",
"operateTime": 1647325085000,
"accountId": 0
},
{
"id": 175,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "onoffline",
"logDetail": "Device offline. The final time when it sends
packets to Cloud is: 2022-03-15 12:04:07(It is an estimated value. The
deviation is 1 minute.)",
"operateTime": 1647324787000,
"accountId": 0
},
{
"id": 148,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "reboot",
"logDetail": "Device restart",
"operateTime": 1647247226000,
"accountId": 0
},
{
"id": 122,
"sn": "123494257001C",
"tenantId": 6128,
"groupId": 67770,
"logType": "reboot",
"logDetail": "Device restart",
"operateTime": 1647238109000,
"accountId": 0
}
]
}
}
2.6.6 Get Device CPU and Memory
Description Query Device current CPU and Memory information
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]
/logbizagent/logbiz/api/sys/current_performance?access_token=
{}
Request GET
Method
QueryParam request parameters:
Paramet Ty Manda Description
er Name pe tory
access_t Str M An access_token is assigned by server to client.
oken ing When the client invokes a RESTful API, it needs
to return the access_token as it is to the server.
The access_token expires after its expiration time
has elapsed, and the client needs to apply for a
new one in order to resume API invocation.
sn Str M The device serial number
ing
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
data
cpuTemp Fl M Fixed to 0, please ignore
oa
t
cpuRate Fl M Current CPU usage, unit is %
oa
t
processNu int M Number of processors
m
memoryRat Fl M Memory usage, unit is %
e oa
t
memoryFre Lo M Free memory
e ng
flashRate Fl M Flash usage
oa
t
flashFree Lo M Free flash
ng
diskRate Fl M Fixed to 0, please ignore
oa
t
diskFree Lo M Fixed to 0, please ignore
ng
Request message example:
curl --request GET
https:/CloudIP/
logbizagent/logbiz/api/sys/current\_performance?access\_token=nb7vWdZ2NrbC1do
i0oA6Y7e6k7omlKMw&sn=123494257001C
Response message example:
{
"code": 0,
"msg": "OK.",
"data": {
"cpuTemp": 0.0,
"cpuRate": 30.0,
"processNum": 179,
"memoryRate": 63.0,
"memoryFree": 114336,
"flashRate": 67.0,
"flashFree": 84892,
"diskRate": 0.0,
"diskFree": 0
}
}
2.6.7 Get Switch Port status
Descripti Query Switch Device Port status
on
Implemen RUIJIE CLOUD
ter
URL [CloudUrlPrefix]/service/api/conf/switch/device/{sn}/ports?page_siz
e=100&page_index=0&access_token={}
Request GET
Method
PathParam request parameters:
Paramet Ty Manda Description
er Name pe tory
sn Str M The device serial number
ing
Page_ind int M Begin index of the record, start with 0. For
ex example, PageSize=10, to get Second page, the
start is (2-1)*PageSize =10
Page_siz int M Page Size for paging return
e
Returned parameters::
Parameter Typ Manda Description
Name e tory
code int M Response code. For details, see the section
about response code description.
msg Strin O Code message. If the operation is successful,
g this parameter is null or is not carried.
list
port int M port ID
order int M The port Id in the panel, such as Gi 1/0/2,
order is 2.
slotOrder int M The slot Id in the panel, such as Gi 1/0/2, the
slotOrder is 0.
devOrder int M The device ID in the panel, such as Gi 1/0/2,
the devOrder is 1.
name Strin O The port name
g
description Strin M The port alias
g
description Strin M The port enable status, true/false
g
type Strin M Access / Trunk type
g
vlan int M If type is access, then vlan is access vlan, If
type is trunk, the vlan is native vlan
vlanlist Strin M If type is trunk, this value is allowed vlan list
g
status Strin M Up/Down/Unknown/Dormant status
g
Speed Strin M Port Speed
g
mediumTy Strin M Copper / Fiber of medium
pe g
mediumTy Strin M Whether support Combo (use either RJ45 or
pe g the SFP port) port, if support then true, others
is false
Mtu int M mtu
duplexMod Strin M Half or Full
e g
isUplink Strin M True or false, if work as uplink port, then it is
g true.
poeStatus Strin M Port poe status, On, Off, Errorneous,
g Unsupport
loopState Strin M True or False, whether under loop status.
g
loopState Strin M True or False
g
switchPort Strin M True or False
Enable g
enableConf Bool M True is can be configured, False is not
ig ean configurable.
message Strin O The message of why can’t be configurable
g
Request message example:
curl --request GET
https://{{maccserver}}/service/api/conf/switch/device/NAEK322EH0002/ports?pag
e\_size=2&page\_index=0&access\_token=Nb9Sr1qKWoS0oS5g9L6ojvlxb8svvWqP
Response message example:
{
"code": 0,
"msg": "OK.",
"portList": [
{
"sn": "NAEK322EH0002",
"port": 0,
"name": "Gi1",
"alias": "Gi1",
"isUplink": "true",
"description": "",
"enable": "true",
"type": "Access",
"vlan": 1,
"vlanList": "",
"untagVlan": "",
"status": "Up",
"speedConf": "Auto",
"speed": "1000M",
"mediumType": "Copper",
"supportMedium": "false",
"portGroupId": 8,
"duplexMode": "Auto",
"duplexModeCurrent": "Full",
"loopState": "false",
"updateTime": 1675604059000,
"switchPortEnable": "true",
"priIpAddrType": "NONE",
"order": 1,
"vsuOrder": 100000,
"devOrder": 1,
"slotOrder": 0,
"poeStatus": "Unsupport",
"productType": "MSW",
"productClass": "NBS3200-48GT4XS",
"enableConfig": true,
"uplink": true,
"aggregatePort": true
},
{
"sn": "NAEK322EH0002",
"port": 1,
"name": "Gi2",
"alias": "Gi2",
"description": "",
"enable": "true",
"type": "Access",
"vlan": 1,
"vlanList": "",
"untagVlan": "",
"status": "Up",
"speedConf": "Auto",
"speed": "1000M",
"mediumType": "Copper",
"supportMedium": "false",
"portGroupId": 8,
"duplexMode": "Auto",
"duplexModeCurrent": "Full",
"loopState": "false",
"updateTime": 1675604059000,
"switchPortEnable": "true",
"priIpAddrType": "NONE",
"order": 2,
"vsuOrder": 100000,
"devOrder": 1,
"slotOrder": 0,
"poeStatus": "Unsupport",
"productType": "MSW",
"productClass": "NBS3200-48GT4XS",
"enableConfig": true,
"uplink": false,
"aggregatePort": true
}
],
"totalCount": 52
}
2.6.8 Get Switch PoE Port Info
Description Query Switch Port Info
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/service/api/conf/switch/device/{sn}/poe/info
Request Method GET
PathParam request parameters:
Parameter Name Type Mandatory Description
sn String M The device serial
number
Returned parameters::
Parameter Typ Manda Description
Name e tory
code int M Response code. For details, see the section
about response code description.
msg Stri O Code message. If the operation is successful,
ng this parameter is null or is not carried.
data Obj
ect[]
port int M port ID
sn Stri M The device serial number
ng
poeAdminS Stri M Poe Switch, On:enable, Off:disable
tatus ng
poeStatus Stri M Poe Status, On:open, Off:shutdown
ng
powerUsed Stri M Device Poe Power Used
ng
Request message example:
curl --request GET
https://{{maccserver}}/service/api/conf/switch/device/{sn}/poe/info?access\_t
oken=Nb9Sr1qKWoS0oS5g9L6ojvlxb8svvWqP
Response message example:
{
"code": 0,
"msg": "OK.",
"data": [
{
"port": 0,
"sn": "NAEK29DFH0005",
"poeAdminStatus": "On",
"poeStatus": "On",
"powerUsed": "5.42 W"
},
{
"port": 1,
"sn": "NAEK29DFH0005",
"poeAdminStatus": "On",
"poeStatus": "On",
"powerUsed": "3.32 W"
}
],
"count": 2
}
2.6.9 Get Switch PoE Power Usage Info
Description Query Switch PoE Power Info
Implementer RUIJIE CLOUD
URL [CloudUrlPrefix]/service/api/conf/switch/device/{sn}/poe/pwr
Request Method GET
PathParam request parameters:
Parameter Name Type Mandatory Description
sn String M The device serial
number
Returned parameters::
Parameter Ty Manda Description
Name pe tory
code int M Response code. For details, see the section
about response code description.
msg Stri O Code message. If the operation is successful,
ng this parameter is null or is not carried.
data Obj
ect
maxPower Stri M Support Max Poe Power
ng
curPower Stri M Current Device Poe Power Consumption
ng
Request message example:
curl --request GET
https://{{maccserver}}/service/api/conf/switch/device/{sn}/poe/pwr?access\_to
ken=Nb9Sr1qKWoS0oS5g9L6ojvlxb8svvWqP
Response message example:
{
"code": 0,
"msg": "OK.",
"data": {
"sn": "NAEK29DFH0005",
"tenantId": 118458,
"groupId": 5805213,
"maxPower": "370.00 W",
"curPower": "16.20 W"
}
}
2.6.10 Get Application Traffic Statistics
Descriptio QueryGateway Application Traffic Statistics
n
Implemente RUIJIE CLOUD
r
URL [CloudUrlPrefix]/logbizagent/logbiz/api/eg/appflow/statistic/data-
minute/appname
Request POST
Method
PathParam request parameters:
Parameter Type Mandatory Description
QueryParam request parameters:
Param Ty Manda Description
eter pe tory
access Str M An access_token is assigned by server to client.
_token ing When the client invokes a RESTful API, it needs to
return the access_token as it is to the server. The
access_token expires after its expiration time has
elapsed, and the client needs to apply for a new
one in order to resume API invocation.
JsonParam request parameters:
Param Type Manda Description
eter tory
groupI Int M Account Root Group ID, all the network Groups
d under this Root Group ID. Create voucher API
not use this GroupId, Groups will be crated at
Ruijie Cloud UI, each group seen as each
network location. Network groups get from API
“2.2.1 Get Network Group List”
sn String M Matching client link serial_number
startTi timest O Start time for statistic, can be null. timestamp
me amp value format(from 1970-1-1 timestamp
milliseconds)
endTi M End time for statistic. If startTime is null,
me endTime value is current time, then return the
latest real-time data. If both startTime and
endTime are not null, will return the aggregate
value of application at this period. timestamp
value format(from 1970-1-1 timestamp
milliseconds)
pageIn M Begin index of the record, start with 0. For
dex example, PageSize=10, to get Second page, the
start is (2-1)*PageSize =10
pageSi M Page Size for paging record items return, if u
ze want to get all profiles, u can set start=0,
pageSize=1000 (if profiles num <1000).
Returned parameters:
Paramete Ty Manda Description
r pe tory
code Int M Response code. For details, see the section
about response code description.
msg Str O Code message. If the operation is successful,
ing this parameter is not carried.
totalCount Int M Application total number
list
appGroup Str M Application Group Type
Name ing
appName Str M Application Name
ing
downFlow Int M Downlink traffic statistics
upFlow Int M Uplink traffic statistics
upDownFl Int M Uplink and downlink traffic statistics
ow
Request message example:
curl --request POST \
--url
'https://[CloudUrlPrefix]/logbizagent/logbiz/api/eg/appflow/statistic/data-mi
nute/appname?access_token=3JVlpDZBkjBov1oj7w0T7M0oKPw5TqrW' \
--header "Content-Type: application/json" \
--data '{
"groupId": 89876,
"sn": "MACCEG2206021",
"endTime": 1702971807000,
"pageIndex": 1,
"pageSize": 10
}'
Response message example:
{
"code": 0,
"list": [
{
"appGroupName": "Other",
"appName": "TikTok",
"downFlow": 35970,
"upDownFlow": 99741,
"upFlow": 63771
},
{
"appGroupName": "Other",
"appName": "Other UDP",
"downFlow": 25130,
"upDownFlow": 83981,
"upFlow": 58851
}
],
"msg": "ok.",
"totalCount": 27
}
Appendix
Appendix 1: Response Code List
code = 0: Operation results are returned correctly.
code > 0: The service logic is not completed properly during API invocation. The
developer must handle the problem.
–50 ≤ code ≤ –1: API invocation does not pass authorization or verification and a
service exception occurs. The developer must handle the problem.
code < –50: An internal error occurs. Contact the RUIJIE CLOUD platform
management personnel.
Respon Error Description
se Message
Code
0 N/A The operation is successful.
1 Appid is The appid is invalid.
invalid.
2 Parameter Request parameters are invalid.
value\ is
invalid.
3 Token is The token is invalid.
invalid.
4 Token is The token expires.
overdued.
5 Unauthorize The API-based access is not authorized.
d API
access.
7 API execute API execution times out.
timeout.
25 Is running API execution is in progress.
–1002 service An internal service error occurs. Contact the
internal error development personnel.
1009 Login failed, Login fails. The cause is provided inside {}, which is
cause: {} not included in the message. For example:Login
failed, cause: incorrect password