Sie sind auf Seite 1von 71

RESTful API

Program Name: cnMaestro

Product Version: 2.1.0 Document Version: 1.0

5/13/19 Page 1 of 71
1 Copyright
© 2019 Cambium Networks Limited. All rights reserved.

This document, Cambium products, and 3rd Party software products described in this document may
include or describe copyrighted Cambium and other 3rd Party supplied computer programs stored in
semiconductor memories or other media. Laws in the United States and other countries preserve for
Cambium, its licensors, and other 3rd Party supplied software certain exclusive rights for copyrighted
material, including the exclusive right to copy, reproduce in any form, distribute and make derivative
works of the copyrighted material. Accordingly, any copyrighted material of Cambium, its licensors, or
the 3rd Party software supplied material contained in the Cambium products described in this
document may not be copied, reproduced, reverse engineered, distributed, merged or modified in any
manner without the express written permission of Cambium. Furthermore, the purchase of Cambium
products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any
license under the copyrights, patents or patent applications of Cambium or other 3rd Party supplied
software, except for the normal non-exclusive, royalty free license to use that arises by operation of
law in the sale of a product.

Restrictions

Software and documentation are copyrighted materials. Making unauthorized copies is prohibited by
law. No part of the software or documentation may be reproduced, transmitted, transcribed, stored in
a retrieval system, or translated into any language or computer language, in any form or by any
means, without prior written permission of Cambium.

License Agreements

The software described in this document is the property of Cambium and its licensors. It is furnished
by express license agreement only and may be used only in accordance with the terms of such an
agreement.

5/13/19 Page 2 of 71
2 Table of Contents
2.1 Contents
1 Copyright ..................................................................................................................... 2
2 Table of Contents .......................................................................................................... 3
2.1 Contents............................................................................................................... 3
2.2 New APIs in 2.2.0 .................................................................................................. 7
2.3 Deprecation/Update Notice for Existing APIs .............................................................. 7
3 Introduction .................................................................................................................. 7
3.1 Overview .............................................................................................................. 7
3.2 Architecture .......................................................................................................... 7
3.2.1 Establish Session............................................................................................... 8
3.2.2 API Access ....................................................................................................... 8
3.2.3 Session Expiration ............................................................................................. 8
3.2.4 Concurrent Access ............................................................................................. 8
3.2.5 Rate Limiting ..................................................................................................... 9
4 Client Id and Client Secret Generation.............................................................................. 9
4.1 cnMaestro User Interface ........................................................................................ 9
4.2 Step 1: Navigate to Services > API Clients................................................................. 9
4.3 Step 2: Create a New API Client .............................................................................. 9
4.4 Step 3: Download the Client Id and Client Secret ........................................................ 9
5 API Session.................................................................................................................10
5.1 Introduction..........................................................................................................10
5.2 Retrieve Access Token..........................................................................................10
5.2.1 cnMaestro On-Premises.....................................................................................10
5.3 Access Resources ................................................................................................11
6 API Details ..................................................................................................................11
6.1 HTTP Protocol......................................................................................................12
6.1.1 HTTP Response Codes .....................................................................................12
6.1.2 HTTP Headers..................................................................................................12
6.2 REST Protocol .....................................................................................................12
6.2.1 Resource URLs ................................................................................................12
6.2.2 Responses.......................................................................................................13
6.3 Parameters ..........................................................................................................14
6.3.1 Field Selection..................................................................................................14
6.3.2 Filtering ...........................................................................................................15
6.3.3 Time Filtering ...................................................................................................15
6.3.4 Sorting ............................................................................................................16
6.3.5 Pagination........................................................................................................16
7 Access API..................................................................................................................17
7.1 token (basic request).............................................................................................17
7.1.1 Request...........................................................................................................17
7.1.2 Response ........................................................................................................18
7.1.3 Example ..........................................................................................................18
7.2 token (alternate request) ........................................................................................18
7.2.1 Request...........................................................................................................18
7.2.2 Response ........................................................................................................19
7.2.3 Example ..........................................................................................................19
7.3 validateToken.......................................................................................................19
7.3.1 Request...........................................................................................................19
7.3.2 Response ........................................................................................................19
7.3.3 Example ..........................................................................................................19
8 Devices API.................................................................................................................20
8.1 GET Device details ...............................................................................................20
8.1.1 Request...........................................................................................................20
8.1.2 Response ........................................................................................................20
8.1.3 Example ..........................................................................................................21
8.2 Onboard Device....................................................................................................22

5/13/19 Page 3 of 71
8.2.1 Request...........................................................................................................22
8.2.2 Response ........................................................................................................23
8.2.3 Example ..........................................................................................................24
8.3 Update Device Configuration ..................................................................................24
8.3.1 Request...........................................................................................................24
8.3.2 Response ........................................................................................................25
8.3.3 Example ..........................................................................................................26
8.4 Device Delete.......................................................................................................26
8.4.1 Request...........................................................................................................27
8.4.2 Response ........................................................................................................27
8.5 Device Operations ................................................................................................27
8.5.1 Overview .........................................................................................................27
8.5.2 Reboot Device..................................................................................................27
8.5.3 Ping ................................................................................................................27
8.5.4 Traceroute .......................................................................................................28
8.5.5 Wi-fi Performance .............................................................................................30
8.5.6 Client Disconnect ..............................................................................................31
8.6 Sub-Resources.....................................................................................................32
9 Jobs API .....................................................................................................................32
9.1 Overview .............................................................................................................32
9.2 GET Jobs ............................................................................................................32
9.2.1 Request...........................................................................................................32
9.2.2 Response ........................................................................................................33
9.2.3 Example ..........................................................................................................33
9.3 GET Configuration Job ..........................................................................................34
9.3.1 Request...........................................................................................................34
9.3.2 Response ........................................................................................................34
9.3.3 Example ..........................................................................................................35
9.4 GET Configuration Job Devices ..............................................................................36
9.4.1 Request...........................................................................................................36
9.4.2 Response ........................................................................................................36
9.4.3 Example ..........................................................................................................36
10 Networks API...............................................................................................................37
10.1 Fetch ..................................................................................................................37
10.1.1 Request .......................................................................................................37
10.1.2 Response.....................................................................................................37
10.1.3 Example ......................................................................................................38
10.2 Create Network ....................................................................................................38
10.2.1 Request .......................................................................................................38
10.2.2 Response.....................................................................................................39
10.2.3 Example ......................................................................................................39
10.3 Update Network....................................................................................................39
10.3.1 Request .......................................................................................................39
10.3.2 Response.....................................................................................................39
10.3.3 Example ......................................................................................................39
10.4 Delete Network .....................................................................................................40
10.4.1 Request .......................................................................................................40
10.4.2 Response.....................................................................................................40
10.5 Sub-Resources.....................................................................................................40
11 Sites API.....................................................................................................................40
11.1 Overview .............................................................................................................40
11.1.1 Request .......................................................................................................41
11.1.2 Response.....................................................................................................41
11.2 Create Site ..........................................................................................................41
11.2.1 Request .......................................................................................................41
11.2.2 Response.....................................................................................................42
11.2.3 Example ......................................................................................................42
11.3 Update Site..........................................................................................................42
11.3.1 Request .......................................................................................................42
11.3.2 Response.....................................................................................................43

5/13/19 Page 4 of 71
11.3.3 Example ......................................................................................................43
11.4 Delete Site...........................................................................................................43
11.4.1 Request .......................................................................................................43
11.4.2 Response.....................................................................................................43
11.5 Sub-Resources.....................................................................................................43
12 Towers API .................................................................................................................44
12.1 Overview .............................................................................................................44
12.1.1 Request .......................................................................................................44
12.1.2 Response.....................................................................................................44
12.2 Create Tower .......................................................................................................44
12.2.1 Request .......................................................................................................45
12.2.2 Response.....................................................................................................45
12.2.3 Example ......................................................................................................45
12.3 Update Tower ......................................................................................................45
12.3.1 Request .......................................................................................................45
12.3.2 Response.....................................................................................................46
12.3.3 Example ......................................................................................................46
12.4 Delete Tower........................................................................................................46
12.4.1 Request .......................................................................................................46
12.4.2 Response.....................................................................................................46
12.5 Sub-Resources.....................................................................................................46
13 Statistics API ...............................................................................................................47
13.1.1 Overview......................................................................................................47
13.1.2 Request .......................................................................................................47
13.1.3 Response.....................................................................................................47
14 Performance API..........................................................................................................50
14.1.1 Device .........................................................................................................50
14.1.2 Request .......................................................................................................50
14.1.3 Response.....................................................................................................51
15 WiFi APIs ....................................................................................................................52
15.1 WiFi Clients .........................................................................................................52
15.1.1 Request .......................................................................................................52
15.1.2 Response.....................................................................................................53
15.2 WiFi Mesh Peers ..................................................................................................53
15.2.1 Request .......................................................................................................53
15.2.2 Response.....................................................................................................53
15.2.3 Example ......................................................................................................54
15.2.4 Sub-Resources .............................................................................................55
15.3 WiFi Clients Summary ............................................................................................56
15.3.1 Request............................................................................................................56
15.3.2 Response .........................................................................................................57
15.3.3 Example............................................................................................................57
16 Alarms API ..................................................................................................................57
16.1 Active Alarms .......................................................................................................57
16.1.1 Request .......................................................................................................57
16.1.2 Response.....................................................................................................58
16.2 Alarm History .......................................................................................................58
16.2.1 Request .......................................................................................................58
16.2.2 Response.....................................................................................................59
17 Events API ..................................................................................................................59
17.1.1 Overview......................................................................................................59
18 Sessions API ...............................................................................................................60
18.1.1 Overview......................................................................................................60
19 Guest Access Portal API ...............................................................................................61
19.1 List of Guest Access Portals ...................................................................................61
19.1.1 Overview......................................................................................................61
19.1.2 Example ......................................................................................................61
19.2 Update Whitelist on Guest Access Portal ..................................................................62
19.2.1 Overview......................................................................................................62
19.2.2 Request .......................................................................................................62

5/13/19 Page 5 of 71
19.2.3 Example ......................................................................................................62
19.3 List of Vouchers....................................................................................................63
19.3.1 Overview......................................................................................................63
19.3.2 Request .......................................................................................................63
19.3.3 Example ......................................................................................................63
19.4 Generate Vouchers ...............................................................................................64
19.4.1 Overview......................................................................................................64
19.4.2 Request .......................................................................................................64
19.4.3 Example ......................................................................................................64
19.5 List of Login events ...............................................................................................65
19.5.1 Overview......................................................................................................65
19.5.2 Request .......................................................................................................65
19.5.3 Example ......................................................................................................66
20 Managed Accounts API .................................................................................................66
20.1.1 Overview......................................................................................................66
20.1.2 Example ......................................................................................................67
20.2 Sub-Resources.....................................................................................................67
21 Sample Python Code ....................................................................................................68
21.1 API Client ............................................................................................................68
21.2 Code...................................................................................................................68
22 Appendix: API List ........................................................................................................69
23 Appendix: Device Details ...............................................................................................70
23.1 Reboot Reason ....................................................................................................70
24 Contacting Cambium Networks.......................................................................................71

5/13/19 Page 6 of 71
2.2 New APIs in 2.2.0
Path Details
Guest Portal API (Section 19.3)
/api/v1/portals/{Portal ID}/vouchers/{voucher plan} List of vouchers
/api/v1/portals/{Portal ID}/vouchers/{voucher
Generate vouchers
plan}/generate
/api/v1/portals/{Portal ID}/events List of guest login events
Devices API (Section 8.5.6)
/api/v1/devices/{MAC Address}/disconnect_clients Disconnect clients under an AP

2.3 Deprecation/Update Notice for Existing APIs


Path Details
Devices API
/api/v1/devices  A new property called site_id is added for WiFi Device
Devices Statistics API
 site_id property is added for WiFi devices only.
 Until 1.6.3 rx_bps, tx_bps was returning values in kilobits per
sec. In 2.x we changed it to return as bits per second
/api/v1/devices/statistics
 Until 1.6.3 tx_bytes, rx_bytes were returning values in kilobits.
In 2.x tx_bytes, rx_bytes will be sending value as bytes.
 session_drops field is deprecated.
Devices Perform ance API
 Until 1.6.3 rx_bps, tx_bps was returning values in kilobits per
sec. In 2.x we changed it to return as bits per second
 Until 1.6.3 throughput was returning values in kilobits per sec.
/api/v1/devices/performance
In 2.x we changed it to return as bits per second
 In 2.x we also changed the response format inside the radio
object.
Sites API
 Sites object will contain created_at field denoting site’s
creation time. From 2.x this API will accept stop_time and
/api/v1/networks/{NID}/sites
start_time header fields which returns sites created within that
period.

3 Introduction
3.1 Overview
cnMaestro supports a RESTful API as part of its On-Premises deployment. This API allows customers
to read data and perform operations programmatically using their own client applications. The API is
supported over HTTPS, and messages are exchanged in JSON format. Modern programming
languages have rich support for RESTful interfaces.

3.2 Architecture
A basic OAuth2 API session is presented below. The client retrieves an Access Token to start the
session. It sends API requests until the Access Token times out, at which point the token can be
regenerated.

5/13/19 Page 7 of 71
cnMaestro
Application
On-Premises

Request Access Token


Retrieve (client_id, client_secret)
Access Token
Response
(access_token, expires_in)

API Call Using Access Token


(access_token)
API
API Call Using Access Token
Access
(access_token)

API Call Using Access Token


(access_token)

3.2.1 Establish Session

A session is created by sending the Client Id and Client Secret to the cnMaestro server. These are
generated in the cnMaestro UI and stored with the application. The Client Id defines the cnMaestro
account and application, and the Client Secret is a private string mapped to the specific application.
The Client Secret should be stored securely.

If the session is established successfully, an Access Token is returned along with an Expiration
string. The Access Token is used to authenticate the session. The Expiration is the interval, in
seconds, in which the Access Token remains valid. If the Access Token expires, a new session needs
to be created.

3.2.2 API Access

With the Access Token, the application can make cnMaestro API calls. The token is sent in an
Authentication header on each API request. Details are provided later in this document.

3.2.3 Session Expiration

If a token expires, an expiration error message is returned to the client. The client can then generate a
new token using the Client Id and Client Secret. Tokens will expire immediately if the Client API
account that created them is deleted. The default expiration time for a token is 3600 seconds (1 hour).
This is configurable in the UI.

3.2.4 Concurrent Access

Each client supports a single Access Token or multiple Access Tokens. Multiple Access Tokens
allows concurrent access.

3.2.4.1 Single Access Token

If only one Access Token is enabled at a time, whenever a new Access Token is generated from the
Client Id and Client Secret, the previous Token will immediately expire.

3.2.4.2 Multiple Access Tokens

If multiple access tokens are supported, then many clients can concurrently access the API. If another
Access Token is created, the previous will remain valid until their original expiration.

5/13/19 Page 8 of 71
3.2.5 Rate Limiting

Request Rate Limiting is not enabled in the On-Premises version of cnMaestro. It is up to the
application owner to make sure requests do not overtax the system.

4 Client Id and Client Secret Generation


4.1 cnMaestro User Interface
The Client Id and Client Secret are created in the cnMaestro user interface by navigating to Services
> API Client. Each client application should be added as an API Client.

4.2 Step 1: Navigate to Services > API Clients

4.3 Step 2: Create a New API Client


Select the button Add API Client to add a client, then fill in the requested details, and click on ‘save’
button.

4.4 Step 3: Download the Client Id and Client Secret


Download and store the Client Id and Client Secret by clicking on the ‘Download Credentials’ button.
Both are required to create an API session.

5/13/19 Page 9 of 71
5 API Session
5.1 Introduction
The cnMaestro API leverages the Client Credentials section of the OAuth 2.0 Authorization
Framework (RFC 6749). An API Session can be created using any modern programming language.
The examples below highlight how messages are encoded and responses returned.

5.2 Retrieve Access Token


5.2.1 cnMaestro On-Premises

Note
The steps below are for the On-Premises release of cnMaestro.

5.2.1.1 Access Token Request (RFC 6749, section 4.4.2)

In order to generate a session, the client should retrieve an access token from cnMaestro. This is
done by base64 encoding the client_id and client_secret downloaded from the cnMaestro
Web UI and sending them to the cnMaestro server. The Authorization header is created by
base64 encoding these fields as defined below. Note the fields are separated by a colon (:):

Authorization: Basic BASE64(<client_id>:<client_password>)

In the body of the POST the parameter grant_type must be set to client_credentials.

POST /api/v1/access/token HTTP/1.1


Host: server.example.com
Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

Alternatively, instead of using the Authorization header, the credentials can be passed within the
body of the POST:

POST /api/v1/access/token HTTP/1.1


Host: server.example.com

5/13/19 Page 10 of 71
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=s6BhdRkqt3&client_secret=7Fjfp0ZBr1KtDRbn
fVdmIw

5.2.1.2 Access Token Response (RFC 6749, section 4.4.3)

The response returned from cnMaestro includes the access_token that should be used in
subsequent requests. The expires_in field defines how many seconds the token is valid.

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"bearer",
"expires_in":3600
}

5.2.1.3 Error Response (RFC 6749, section 5.2)

If there is an error, an HTTP 400 (Bad Request) error code is returned along with one of the following
error messages:

Cause Details
InvalidClientIdAndSecret Required parameter is missing from the request.
InvalidClientIdAndSecret Client authentication failed.
InvalidRequest The client is not authorized to use the grant type sent.
I nvalidRequest The grant type is not supported.

An example error response is below.

HTTP/1.1 400 Bad Request


Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

{
"error": {
"cause": "InvalidRequest",
"message": "Unsupported grant_type value"
}
}

5.3 Access Resources


Once the access_token is retrieved, API requests are sent to cnMaestro server using the format
below. The access_token is sent within the HTTP Authorization header.

GET https://bdo300asdsd3.cloud.cambiumnetworks.com/api/v1/inventory/device
Accept: application/json
Authorization: Bearer ACCESS_TOKEN

6 API Details

5/13/19 Page 11 of 71
6.1 HTTP Protocol
6.1.1 HTTP Response Codes

The following response codes are supported in cnMaestro and may be returned through the HTTP
protocol.

Code Description Use in cnMaestro


200 OK Standard response for successful HTTP requests.
400 Bad Request Status field in request validation related errors.
401 Unauthorized User tried to access a resource w ithout authentication.
403 Forbidden An authenticated user tries to access a non-permitted resource.
404 Not Found Server could not locate the requested resource.
405 Method Not Allow ed A method (GET, PUT, POST) is not supported for the resource.
413 Payload Too Large The request is larger than the server is w illing to handle
422 Unprocessable Entity The server understands the request but cannot process it.
429 Too Many Requests The client has sent too many requests in a given interval.
Request Header Fields
431 The header fields are too large to be processed.
Too Large
500 Internal Server Error A server-side error happened during processing the request.
501 Not Implemented The request method is not recognized.
502 Bad Gatew ay Internal server error that may require a reboot.
503 Service Unavailable Internal server error that may require a reboot.

6.1.2 HTTP Headers

6.1.2.1 Request Headers

Header Details
Used in every API request to send the Access Token.
Authorization
Example: Authorization: Bearer <Access-Token>
Accept Set to application/json
Content-Type Set to application/json

6.2 REST Protocol


6.2.1 Resource URLs

The format for cnMaestro path and parameters are the following:

Access a collection of resources:

/api/{version}/{resource}?{parameter}={value}&{parameter}={value}

Access a single resource:

/api/{version}/{resource}/{resource_id}?{parameter}={value}&{parameter}={value}

Access a sub-resource on a collection (this is also possible on single resources):

/api/{version}/{resource}/{sub-resource}?{parameter}={value}&{parameter}={value}

For example – read the statistics for MAC, Type, and IP on all devices:

/api/v1/devices/statistics?fields=mac,type,ip_wan

Version

5/13/19 Page 12 of 71
The version is equal to v1 in this release.

Resource

Resources are the basic objects in the system.

Context Details
alarms Current active alarms.
alarms/history Historical alarms, including active alarms.
devices Devices, including ePMP, PMP, and WiFi.
events Historical events.
msp MSP managed services.
networks Configured netw orks.
sites Configured WiFi sites.
towers Configured Fixed Wireless tow ers.

Sub-Resources

Sub-Resources apply to top-level resources. They provide a different view of the resource data, or a
filtered collection based upon the resource. They include:

Context Details
alarms Alarms mapped to the top-level resource.
alarms/history Historical alarms mapped to the top-level resource.
clients Wireless LAN clients mapped to the top-level resource.
devices Devices mapped to the top-level resource.
events Events mapped to the top-level resource.
mesh/peers Wireless LAN mesh peers mapped to the top-level resource.
operations Operations available to the top-level resource
performance Performance data for the top-level resource.
statistics Statistics for the top-level resource.

6.2.2 Responses

Successful Response

In a successful HTTP 200 response, data is returned using the following structure. The actual payload
is presented in JSON format. The request URL is:
/api/v1/devices?fields=mac,type&limit=5

{
"paging": {
"offset": 0,
"limit": 5,
"total": 540
},
"data": [
{
"mac": "C1:00:0C:00:00:21",
"type": "wifi-home"
},
{
"mac": "C1:00:0C:00:00:18",
"type": "wifi-home"
},
{
"mac": "C1:00:0C:00:00:12",

5/13/19 Page 13 of 71
"type": "wifi-home"
},
{
"mac": "C1:00:0C:00:00:15",
"type": "wifi-home"
},
{
"mac": "C1:00:0C:00:00:06",
"type": "wifi-home"
}
]
}

Error Response

Error responses return a message and an error cause. If the start_time and stop_time are mandatory
query parameters and some once missed to provide them in the url will give the following error
response with message and cause.

{
"error": {
"message": "Missing required property: stop_time \n Missing required
property: start_time",
"cause": "InvalidInputError"
}
}

6.3 Parameters
Most APIs can be modified to filter the data and limit the number of entries returned. The parameter
options are listed below. The specific fields, and the appropriate values, vary for each API.

6.3.1 Field Selection

Field selection is supported through the optional “fields” parameter, which can specify the specific
data to return from the server. If this parameter is missing, all available fields will be returned.

Parameter Details
Define exactly w hat fields should be returned in a request. The names are
fields
provided as a comma-separated list.

Fields can limit which JSON parameters are returned.

Example: To retrieve name, type and location information for all devices.
Request: /api/v1/devices?fields=mac,type
Response:
{
"paging": {
"total": 3,
"limit": 100,
"offset": 0
},
"data": [
{
"mac": "00:44:E6:34:89:48",
"type": "wifi-enterprise"
},
{
"mac": "00:44:16:E5:33:E4",
"type": "wifi-enterprise"
},
{

5/13/19 Page 14 of 71
"mac": "00:44:26:46:32:22",
"type": "wifi-enterprise"
}
]
}

6.3.2 Filtering

A subset of fields support filtering. These are defined as query parameters for a particular resource,
and they are listed along with the API specification. Some of the standard filtering parameters are
below:

Field Details
network (Devices) Configured Netw ork name.
severity (Alarms, Events) Alarm or Event severity (critical, major, minor, notice).
site (Devices) Configured Site name.
state (Alarms) Alarm state (active, cleared).
status (Devices) Device status [online, offline, onboarding]
tower (Devices) Configured Tow er name.
(Devices) Device type [epmp, pmp, wifi-enterprise, wifi-home, wifi] (wifi
type
includes wifi-home and wifi-enterprise).

Filters can be used simultaneously for Resources and Sub-Resources.

Example: Retrieve all WiFi devices that are online.


Request: /api/v1/devices?type=wifi&status=online
Response:
{
"paging": {
"total": 1,
"limit": 100,
"offset": 0
},
"data": [
{
"ip": "233.187.212.38",
"location": {
"type": "Point",
"coordinates": [
77.55310127974755,
12.952351523837196
]
},
"mac": "C1:00:0C:00:00:24",
"msn": "SN-C1:00:0C:00:00:24",
"name": "Hattie",
"network": "Bangalore",
"product": "cnPilot R201",
"registration_date": "2017-05-23T21:28:37+05:30",
"status": "offline",
"tower": "Bangalore_Industrial",
"type": "wifi-home",
"hardware_version": "V1.1",
"software_version": "2.4.4",
"status_time": 1495560086
}
]
}

6.3.3 Time Filtering

Events, Alarms, and Performance data can be filtered by date and time using ISO 8601 format.

5/13/19 Page 15 of 71
Example: January 12, 2015 UTC would be encoded as 2015-01-12
Example: January 12, 2015 1:00 PM UTC would be encoded as 2015-01-12T13:00:00Z

The parameters are below. If they are not specified, then the start or stop times will be open-ended.

Parameter Details
start_time Inclusive start time of interval.
stop_time Inclusive stop time of interval.

6.3.4 Sorting

Sorting is supported on a selected subset of fields within certain requests. sort is used to specify
sorting columns. The sort order is ascending unless the path name is prefixed with a ‘-‘, in which case
it would be descending.

Parameter Details
sort Used to get the records in the order of the given attribute.

Example: To retrieve devices in sorted (ascending) order by name.


Request: /api/v1/devices?sort=name

Example: To retrieve devices in sorted (descending) order by mac.


Request: /api/v1/devices?sort=-mac

6.3.5 Pagination

The limit and offset query parameters are used to paginate responses.

Parameter Details
limit Maximum number of records to be returned from the server.
offset Starting index to retrieve the data.

Example: To retrieve the first 10 ePMP devices


Request: /api/v1/devices?offset=3&limit=1
Response:
{
"paging": {
"total": 6,
"limit": 1,
"offset": 3
},
"data": [
{
"status": "online",
"product": "cnPilot E400",
"network": "Mumbai",
"software_version": "3.3-b14",
"registration_date": "2017-04-28T08:57:33+00:00",
"site": "Central",
"hardware_version": "Force 200",
"status_time": "3498",
"msn": "W8SF0759MBDH",
"mac": "00:04:36:46:34:AA",
"location": {
"type": "Point",
"coordinates": [
0,
0

5/13/19 Page 16 of 71
]
},
"type": "wifi-enterprise",
"name": "E400-4634AA"
}
]
}

Internal Response Limits

When clients try to access a resource type without pagination, the server will return the first 100
entries that match the filter criteria. The response will always carry a metadata to convey total count
and current offset and limit. Maximum number of results at any point is 100 even though limit provided
as more than 100.

Example: To retrieve all devices.


Request: /api/v1/devices
Response:
{
data: {devices: [ {name: ‘ePMP_5566’, type:’ePMP’, location:’blr’} , {….}… ] },
paging:{
"limit":25,
"offset":50,
"total":100
}
}

The response returns the following values in the paging section:

Parameter Details
limit Current setting for the limit.
offset Starting index for the records returned in the response (begins at 0).
total Total number of records that can be retrieved.

7 Access API
7.1 token (basic request)
POST /api/v1/access/token

Generate an Access Token using the Client Id and Client Password created in the cnMaestro UI. The
token can be leveraged for API calls through the expiration time. Only one token is supported for each
Client Id at any given time.

7.1.1 Request

Headers

Header Value
Accept (optional) application/json
Authorization Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW
Content-Type application/x-www-form-urlencoded

The client_id and client_secret are encoded and sent in the Authorization header. The
encoding is:

BASE64(client_id:client_secret)

Body

5/13/19 Page 17 of 71
The body needs to have the grant_type.

grant_type=client_credentials

7.1.2 Response

The response returns credentials for API access.

Body

Name Details
access_token Access token to return w ith each API request.
expires_in Time in seconds that the API session w ill remain active.
token_type This w ill alw ays be bearer.
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"bearer",
"expires_in":3600
}

7.1.3 Example

Request
curl https://10.110.134.12/api/v1/access/token \
-X POST -k \
-u 8YKCxq72qpjnYmXQ:pcX5BmdJ2f4QLM5RfgsS4jOtxAdTRF \
-d grant_type=client_credentials
Response
{"access_token":"d587538f445d30eb2d48e1b7f7a6c9657d32068e","token_type":"
bearer","expires_in":86400}

7.2 token (alternate request)

POST /api/v1/access/token

An alternative form is supported in which the client_id and client_secret are sent in the body,
rather than the Authorization header.

7.2.1 Request

Headers

Header Value
Accept (optional) application/json
Content-Type application/x-www-form-urlencoded

Body

grant_type=client_credentials&client_id=s6BhdRkqt3&client_secret=7Fjfp0ZBr1KtDRbn
fVdmIw

5/13/19 Page 18 of 71
7.2.2 Response

The response to both forms is the same.

Body

Name Details
access_token Access token to return w ith each API request.
expires_in Time in seconds that the API session w ill remain active.
token_type This w ill alw ays be bearer.
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"bearer",
"expires_in":3600
}

7.2.3 Example

Request
curl https://10.110.134.12/api/v1/access/token \
-X POST -k \
-d grant_type=client_credentials \
-d client_id=8YKCxq72qpjnYmXQ \
-d client_secret=pcX5BmdJ2f4QLM5RfgsS4jOtxAdTRF
Response
{"access_token":"ee4e077cf457196eb4d27cf6f02686dc07763059","token_type":"
bearer","expires_in":86400}

7.3 validateToken
GET /api/v1/access/validate_token

Verify an Access Token is valid and return the time remaining before it expires.

7.3.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

7.3.2 Response

Body

Name Details
expires_in Time in seconds that the API session w ill remain active.
{
'expires_in': 86399
}

7.3.3 Example

5/13/19 Page 19 of 71
Request
curl https://10.110.134.12/api/v1/access/validate_token \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{"expires_in":85643}

8 Devices API
8.1 GET Device details
GET /api/v1/devices

GET /api/v1/devices/{MAC Address}

8.1.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).
network Netw ork filter (text name of the netw ork).
status Device status filter [online, offline, onboarding]
site Site filter (text name of the site).
sort Sort fields [mac, name, registration_date]
tower Tow er filter (text name of the tow er).
type Type of the device [epmp, pmp, wifi-home, wifi-enterprise]

8.1.2 Response

Body

Name Details ePMP PMP WiFi cnReach


ap_group AP group X X
config.sync_reason Configuration synchronization reason X X X X
config.sync_status Configuration synchronization status X X X X
Device is mapped to configuration
config.variables X X X X
variables
config.version Current configuration version X X X X
country Country X X X X
description Description X X X X
hardware_version Hardw are version X X X X
inactive_software_version Inactive softw are version X X X
ip IP address X X X X
last_reboot_reason Reason for the last reboot (see 23.1) X X X X

5/13/19 Page 20 of 71
location Location X X X X
mac MAC address X X X X
managed_account Managed account name X X X X
maximum_range Maximum range X X
msn Manufacturer serial number X X X X
name Device name X X X X
network Netw ork X X X X
product Product name X X X X
registration_date Registration date X X X X
site Site X
site_id Site unique identifier X
software_version Active Softw are version X X X X
Status (online, offline,
status X X X X
onboarding).
status_time Uptime/dow ntime time interval (sec) X X X X
tower Tow er X X X
Device type (epmp, pmp, wifi-home,
type X X X X
wifi-enterprise)

8.1.3 Example

Request
curl https://10.110.134.12/api/v1/devices \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"paging": {
"offset": 0,
"limit": 100,
"total": 2
},
"data": [
{
"ap_group": "automation1",
"config": {
"sync_reason": "Device's mapped profile updated",
"sync_status": false,
"variables": {
"VLAN_1_MODE": "static",
"VLAN_1_IP": "10.110.212.105",
"VLAN_1_MASK": "255.255.255.0",
"DEFAULT_GW": "10.110.212.254",
"DNS_SERVER_1": "10.110.12.110",
"DNS_SERVER_2": "10.110.12.111",
"DISPLAY_NAME": "400-105"
},
"version": 5
},
"hardware_version": "Dual-Band Indoor Omni 802.11ac",
"ip": "10.110.212.105",
"location": {
"coordinates": [
78.486671,
17.385044
],
"type": "Point"
},
"mac": "00:04:56:AC:42:5A",
"managed_account": "",
"msn": "W8RK238260NF",
"name": "400-105",
"network": "Automation",
"product": "cnPilot E400",

5/13/19 Page 21 of 71
"registration_date": "2017-05-31T09:58:32+00:00",
"site": "Automation-site2",
"software_version": "3.3-r16",
"status": "offline",
"status_time": 10459542,
"type": "wifi-enterprise",
"site_id": "Automation-site-id"

},
{
"ap_group": "automation2",
"config": {
"sync_reason": "Device's mapped profile updated",
"sync_status": false,
"variables": {
"VLAN_1_MODE": "static",
"VLAN_1_IP": "10.110.212.125",
"VLAN_1_MASK": "255.255.255.0",
"DEFAULT_GW": "10.110.212.254",
"DNS_SERVER_1": "10.110.12.110",
"DNS_SERVER_2": "10.110.12.111",
"DISPLAY_NAME": "E500-1256"
},
"version": 5
},
"hardware_version": "Dual-Band Outdoor Omni 802.11ac",
"ip": "10.110.212.125",
"location": {
"coordinates": [
78.486671,
17.385044
],
"type": "Point"
},
"mac": "00:04:56:BB:13:42",
"managed_account": "testmsp",
"msn": "W8SG4152XHM0",
"name": "E500-1256",
"network": "Automation",
"product": "cnPilot E500",
"registration_date": "2017-05-31T09:58:32+00:00",
"site": "Automation-site2",
"software_version": "3.3-r16",
"status": "offline",
"status_time": 10459550,
"type": "wifi-enterprise",
"site_id": "Automation-site-id"
}
]
}

8.2 Onboard Device


The table below list all operations currently supported and their device types.

Details ePMP PMP WiFi cnReach


Claim a device using API X X X X

POST /api/v1/devices

8.2.1 Request

HTTP Headers

5/13/19 Page 22 of 71
Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body Parameters

Header Value
ap_group Set the AP group name for the device
approved Pre-Approve the device during claim [ true, false ]
description Basic information about the device
latitude Set the latitude for the device
longitude Set the longitude for the device
mac MAC address of the device (required)
Set Managed account name if device needs to be claimed in a non
managed_account
admin account
name Set the name of the device
network Set the netw ork name for the device
true/false if user w ants to override the default VLAN w hich device is
overrides.auto_set.network
using to connect w ith maestro
overrides.channel_24 [Override] Radio 2.4 GHz channel settings defined in AP group
overrides.channel_5 [Override] Radio 5 GHz channel settings defined in AP group
[Override] Default gatew ay device used to connect w ith maestro, only
overrides.default_gw
applicable if overrides.auto_set.network is set to false
[Override] Primary DNS server, only applicable if
overrides.dns_server_1
overrides.auto_set.network is set to false
[Override] Secondary DNS server, only applicable if
overrides.dns_server_2
overrides.auto_set.network is set to false
overrides.power_24 [Override] Pow er level for 2.4 GHz radio defined in AP group
overrides.power_5 [Override] Pow er level for 5 GHz radio defined in AP group
Set the site name for the Wi-Fi devices only parameter [w ifi-enterprise or
site
w ifi-home]
software_version Provision the softw are version of the device during onboarding
template Specify the configuration template to apply to the device
type Device type [epmp, pmp, wifi-enterprise, wifi-home] (required)
[Override] Set all the User-Defined Overrides variables defined inside
variables the AP group. It is of type object w ith all the user-defined parameter
[key-value]
It’s an array of object w here multiple VLAN settings can be overridden
defined inside the AP group. For the VLAN ID that the device uses to
vlans
connect to cnMaestro, these are only applicable if
overrides.auto_set.network is set to false
vlans[0].id [Override] VLAN ID [1-4094]
vlans[0].ip [Override] IP address of the device to be set on VLAN <id>
vlans[0].mask [Override] 32 Bit mask used to divide an IP
vlans[0].mode [Override] IP mode [dhcp, static]
An array of objects w here multiple WLAN settings can be overridden.
wlans
WLANs are specified w ithin the AP group.
wlans[0].id [Override] The current SSID of the WLAN being overridden
wlans[0].passphrase [Override] Passw ord for SSID
wlans[0].shutdown [Override] Enable/disable WLAN [true, false]
wlans[0].ssid [Override] The desired SSID for this WLAN

8.2.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

Body

Name Details ePMP PMP WiFi cnReach

5/13/19 Page 23 of 71
mac MAC of device (essentially the id) X X X X

8.2.3 Example

Request
curl https://10.110.134.12/api/v1/devices \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"mac":"11:22:33:44:55:66",
"name": "Test",
"type": "wifi-enterprise",
"approved": true,
"software_version":"3.7.1-r3",
"ap_group":"Default Enterprise",
"overrides":{
"power_5":"5",
"power_24":"5",
"channel_5":"40",
"channel_24":"11",
"default_gw":"192.168.1.254",
"dns_server_1":"1.1.1.1",
"dns_server_2":"1.1.0.0",
"auto_set":{
"network": false
},
"vlans":[{
"id":1,
"ip":"192.162.1.1",
"mask":"255.255.255.0",
"mode":"static"
}],
"wlans":[{
"id":"cnPilot",
"ssid":"FREE_WIFI",
"passphrase":"******",
"shutdown":false
}]
},
"variables":{
"FOO":"New_value",
"BAR":"12345"
}
}

8.3 Update Device Configuration


The table below list all operations currently supported and their device types.

Details ePMP PMP WiFi cnReach


Update a device X X X X

PUT /api/v1/devices/{MAC Address}

8.3.1 Request

HTTP Headers

Header Value

5/13/19 Page 24 of 71
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body Parameters

Header Value
ap_group Set the AP group name for the device
approved Pre-Approve the device during claim [true, false]
description Basic information about the device
latitude Set the latitude for the device
longitude Set the longitude for the device
managed_account Set the managed account name if the device needs to be moved
name Set the name of the device
network Set the netw ork name for the device
true/false if user w ants to override the default VLAN w hich device is
overrides.auto_set.network
using to connect w ith maestro
overrides.channel_24 [Override] Radio 2.4 GHz channel settings defined in AP group
overrides.channel_5 [Override] Radio 5 GHz channel settings defined in AP group
[Override] Default gatew ay device used to connect w ith maestro, only
overrides.default_gw
applicable if overrides.auto_set.network is set to false
[Override] Primary DNS server, only applicable if
overrides.dns_server_1
overrides.auto_set.network is set to false
[Override] Secondary DNS server, only applicable if
overrides.dns_server_2
overrides.auto_set.network is set to false
overrides.power_24 [Override] Pow er level for 2.4 GHz radio defined in AP group
overrides.power_5 [Override] Pow er level for 5 GHz radio defined in AP group
Set the site name for the w ifi devices only parameter [w ifi-enterprise or
site
w ifi-home]
software_version Provision the softw are version of the device during onboarding
template Specify the configuration template to apply to the device
[Override] Set all the User-Defined Overrides variables defined inside
variables the AP group. It is of type object w ith all the user-defined parameter
[key-value]
It’s an array of object w here multiple VLAN settings can be overridden
defined inside the AP group. For the VLAN ID that the device uses to
vlans
connect to cnMaestro, these are only applicable if
overrides.auto_set.network is set to false
vlans[0].id [Override] VLAN ID [1-4094]
vlans[0].ip [Override] IP address of the device to be set on VLAN <id>
vlans[0].mask [Override] 32 Bit mask used to divide an IP
vlans[0].mode [Override] IP mode [dhcp, static]
An array of objects w here multiple WLAN settings can be overridden.
wlans
WLANs are specified w ithin the AP group.
wlans[0].id [Override] The current SSID of the WLAN being overridden
wlans[0].passphrase [Override] Passw ord for SSID
wlans[0].shutdown [Override] Enable/Disable WLAN [true, false]
wlans[0].ssid [Override] The desired SSID for this WLAN

8.3.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details). If success and an ap_group or template was specified, a Job
is created and started.

Body

Name Details ePMP PMP WiFi cnReach


Error object if any error occurred during
error X X X X
execution.
Identifier for Job created, if applicable. Only
job_id X X X X
applicable if a new configuration job is

5/13/19 Page 25 of 71
actually created as a result of setting
“ap_group”.
message Result message. X X X X
If a job w as created, indicates if it w as started
state X X X X
or not started. [“started”, “not_started”]

Note
The Job can be tracked using the job_id, to determine if it completes successfully.

8.3.3 Example

Request
curl https://10.110.134.12/api/v1/devices /11:22:33:44:55:66 \
-X PUT -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "Test",
"software_version":"3.7.1-r3",
"ap_group":"Default Enterprise",
"overrides":{
"power_5":"5",
"power_24":"5",
"channel_5":"40",
"channel_24":"11",
"default_gw":"192.168.1.254",
"dns_server_1":"1.1.1.1",
"dns_server_2":"1.1.0.0",
"auto_set":{
"network": false
},
"vlans":[{
"id":1,
"ip":"192.162.1.1",
"mask":"255.255.255.0",
"mode":"static"
}],
"wlans":[{
"id":"cnPilot",
"ssid":"FREE_WIFI",
"passphrase":"******",
"shutdown":false
}]
},
"variables":{
"UNIQUE_PLACEMENT":"indoor",
"SSH_ENABLE":"true"
}
}

8.4 Device Delete


The table below list all operations currently supported and their device types.

Details ePMP PMP WiFi cnReach


Unclaim a device X X X X

DELETE /api/v1/devices/{MAC Address}

DELETE /api/v1/msp/managed_accounts/{msp_name}/devices/{MAC Address}

5/13/19 Page 26 of 71
8.4.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

8.4.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details). If success, device is deleted.

8.5 Device Operations


8.5.1 Overview

The table below list all operations currently supported and their device types.

Operation Details ePMP PMP WiFi cnReach


Reboot Device Reboot a single device X X X X
Ping Command to run PING test X X X X
Traceroute Command to run TRACEROUTE test X X X
Wi-fi performance Command to run WiFiPerf X

8.5.2 Reboot Device

POST /api/v1/devices/{MAC Address}/reboot

Reboot the selected device.

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

8.5.3 Ping

POST /api/v1/devices/{MAC Address}/ping

The PING Test uses HTTP POST to start the test and HTTP GET to retrieve the results. The MAC
address is the AP running the test.
HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Parameters

Header Type Value

5/13/19 Page 27 of 71
count integer No of packets (1 - 10) (-c)
destination string Hostname or IP Address of the destination (required)
packetsize integer Buffer size (1 - 1500) (-s)

Request
curl https://10.110.134.12/api/v1/devices/11:22:33:44:55:66/ping \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"destination": "www.google.com"
}
Response
{
"data": {
"result": "Please fetch the status using GET request before it expires in
5 mins",
"url": "/api/v1/devices/11:22:33:44:55:66/ping"
}
}

8.5.3.1 Retrieve Results

GET /api/v1/devices/{MAC Address}/ping

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Request
curl https://10.110.134.12/api/v1/devices/11:22:33:44:55:66/ping \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"message": {
"status": "Complete",
"data": [
"PING www.google.com (216.58.194.68): 32 data bytes \n40 bytes from
216.58.194.68: seq=0 ttl=51 time=26.229 ms\n40 bytes from 216.58.194.68: seq=1
ttl=51 time=25.996 ms\n40 bytes from 216.58.194.68: seq=2 ttl=51 time=25.730
ms\n",
"40 bytes from 216.58.194.68: seq=3 ttl=51 time=25.928 ms \n40 bytes
from 216.58.194.68: seq=4 ttl=51 time=25.864 ms \n",
"\n--- www.google.com ping statistics ---\n5 packets transmitted, 5
packets received, 0% packet loss\nround-trip min/avg/max = 25.730/25.949/26.229
ms\n"
]
}
}

8.5.4 Traceroute

POST /api/v1/devices/{MAC Address}/traceroute

The Traceroute Test uses HTTP POST to start the test and HTTP GET to retrieve the results. The
MAC address is the AP running the test.

5/13/19 Page 28 of 71
HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Parameters

Header Type Value


destination string Hostname or IP Address of the destination (required)
fragment Boolean Fragment probe packets (-F) [true, false] default false
Trace method (-I) [ICMP, UDP] default ICMP
method string
Note: ICMP maps to the ‘raw ’ selection, and UDP maps to the ‘dgram’ selection in
the Linux traceroute command.
ttl Boolean Display TTL [true, false] default false
verbose Boolean Verbose output (-v) [true, false] default false

Request
curl https://10.110.134.12/api/v1/devices/{MAC Address}/traceroute \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"destination": "www.google.com"
}
Response
{
"data": {
"result": "Please fetch the status using GET request before it expires in
5 mins",
"url": "/api/v1/devices/11:22:33:44:55:66/traceroute"
}
}

8.5.4.1 Retrieve Results

GET /api/v1/devices/{MAC Address}/traceroute

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Request
curl https://10.110.134.12/api/v1/devices/11:22:33:44:55:66/traceroute \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"message": {
"status": "Complete",
"data": [
"traceroute to www.google.com (216.58.194.36), 30 hops max, 38 byte
packets\n 1 10.120.154.254 (10.120.154.254) 0.466 ms 0.388 ms 0.363 ms\n 2",
" *",
" *"
]
}
}

5/13/19 Page 29 of 71
8.5.5 Wi-fi Performance

POST /api/v1/devices/{MAC Address}/wi-fiperf

The wi-fi performance uses HTTP POST to start the test and HTTP GET to retrieve the results. The
MAC address is the AP running the test. It is supported only for cnPilot E and cnPilot R series device.

Note: Minimum supported software version for cnPilot E is 3.2 and cnPilot R is 4.3.3. WifiPerf daemon
should be running on both endpoints. WifiPerf performance interoperates with the open source
zapwireless tool. Download instructions are provided in cnMaestro user guide (
https://support.cambiumnetworks.com/files/cnmaestro/ ).

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Parameters

Header Type Value


direction string Speed test direction ["uplink", "dow nlink"] (required)
Specify IP Address to test against cnPilot AP. If none is specified then cnMaestro
destination string On-Premises IP address is resolved.
Note: WifiPerf daemon has to be running on destination if specified
protocol string w i-fi performance protocol [udp, tcp] default udp

Request
curl https://10.110.134.12/api/v1/devices/{MAC Address}/wi-fiperf \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"destination": "www.google.com",
"direction": "downlink"
}
Response
{
"data": {
"result": "Please fetch the status using GET request before it expires in
5 mins",
"url": "/api/v1/devices/11:22:33:44:55:66/wi-fiperf"
}
}

8.5.5.1 Retrieve Results

GET /api/v1/devices/{MAC Address}/wi-fiperf

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Request
curl https://10.110.134.12/api/v1/devices/11:22:33:44:55:66/ wi-fiperf \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"

5/13/19 Page 30 of 71
Response
{
"message": {
"status": "complete",
"source": "10.120.154.19",
"destination": "10.120.154.132",
"throughput": "395.8mbps",
"average": "342.6",
"dropped": "0"
}
}

8.5.6 Client Disconnect

POST /api/v1/devices/{MAC Address}/disconnect_clients

The Client Disconnect uses HTTP POST to start the client disconnect and HTTP GET to retrieve the
results. The MAC address is the AP on which clients will be disconnected.

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Parameters

Header Type Value


List of clients MAC. If all clients needs to disconnected pass ‘all’ and in case of
clients array mesh clients ‘mesh-all’. For example { clients: [‘all’] } (required).
Note: mesh client MAC should be hyphen separated

Request
curl https://10.110.134.12/api/v1/devices/{MAC Address}/disconnect_clients \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"clients": [‘all’]
}
Response
{
"data": {
"result": "Please fetch the status using GET request before it expires in
5 mins",
"url": "/api/v1/devices/11:22:33:44:55:66/disconnect_clients"
}
}

8.5.6.1 Retrieve Results

GET /api/v1/devices/{MAC Address}/disconnect_clients

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Request

5/13/19 Page 31 of 71
curl https://10.110.134.12/api/v1/devices/11:22:33:44:55:66/ disconnect_clients \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"message": {
"status": "Complete"
}
}

8.6 Sub-Resources
The following sub-resources can be applied to Devices URLs.

/api/v1/devices/alarm s Alarms for all devices in system.


/api/v1/devices/alarm s/history Alarm history for all devices in system.
/api/v1/devices/events Events for all devices in system.
/api/v1/devices/performance Performance data for Base infrastructure devices in system.
/api/v1/devices/statistics Statistics for Base Infrastructure devices in system.
/api/v1/devices/{MAC Address}/alarms Alarms for MAC device.
/api/v1/devices/{MAC Alarm history for MAC device.
Address}/alarm s/history
/api/v1/devices/{MAC Address}/clients Wi-Fi Clients
/api/v1/devices/{MAC Address}/events Events for MAC device.
/api/v1/devices/{MAC Performance data for MAC device.
Address}/performance
/api/v1/devices/{MAC Statistics data for MAC device.
Address}/statistics

9 Jobs API
9.1 Overview
The Jobs API returns details on pending and completed Jobs. (Only Configuration Jobs are currently
supported.)

9.2 GET Jobs


Gets all jobs visible to the account.

GET /api/v1/jobs

GET /api/v1/msp/managed_accounts/{msp_name}/jobs

9.2.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
limit, offset Pagination functionality.
managed_account Managed account name filter.

5/13/19 Page 32 of 71
Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),
devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

9.2.2 Response

Body

Name Details
completion_time Completion datetime of job
created_by Job creator
creation_time Creation datetime of job
description Description of job
Contains information specific to configuration job
details
types.
Contains information on the AP Group or Template
details.[ap_group|template]
applied if the job is for Wi-Fi devices.
details.[ap_group|template].managed_account Account that ow ns the AP Group or Template
details.[ap_group|template].name Name of the AP Group or Template.
true if the AP Group or Template is a shared
details.[ap_group|template].shared
resource. false otherw ise.
Number of devices allow ed to be configured in
details.device_limit
parallel for this job. 0 for no limit.
true if the configuration job should be stopped if an
details.stop_on_error
error occurs. false otherw ise.
devices.count Number of devices w ithin this job
devices.failed Number of devices that failed to be configured
devices.remaining Number of devices that are yet to be configured
devices.skipped Number of devices that w ere skipped
Number of devices that have been configured
devices.success
successfully
job_id Unique ID of this configuration job
display_id Job ID show n in cnmaestro UI
managed_account Account that created the job
Current state of job. “not_started”, “stopped”,
state
“complete”, “in_progress”, “aborted”
Job type. Currently only “configuration” is
type
available.

9.2.3 Example

Request
curl https://10.110.134.12/api/v1/jobs \
-X GET -k \
-H “Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059 ”
Response
{
"paging": {
"offset": 0,
"limit": 100,
"total": 1
},
"data": [
{
"completion_time": "2018-08-15T15:48:08+00:00",
"created_by": "Administrator",
"creation_time": "2018-08-15T15:42:51+00:00",
"description": "1 ePMP 1000 device(s)",
"details": {
"device_limit": 0,

5/13/19 Page 33 of 71
"stop_on_error": false,
"template": {
"name": "ePMP timeout",
"managed_account": "",
"shared": true
}
},
"devices": {
"count": 1,
"failed": 1,
"remaining": 0,
"skipped": 0,
"success": 0
},
"job_id": 1,
"display_id": 1,
"managed_account": "",
"state": "complete",
"type": "configuration"
}
]
}

9.3 GET Configuration Job


Gets a specific configuration job based on the job ID.

GET /api/v1/jobs/{job_id}

GET /api/v1/msp/managed_accounts/{msp_name}/jobs/{job_id}

9.3.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

9.3.2 Response

Body

Name Details
completion_time Completion datetime of job
created_by Job creator
creation_time Creation datetime of job
description Description of job
Contains information specific to configuration job
details
types.

5/13/19 Page 34 of 71
Contains information on the AP Group or Template
details.[ap_group|template]
applied if the job is for Wi-Fi devices.
details.[ap_group|template].name Name of the AP Group or Template.
details.[ap_group|template].managed_account Account that ow ns the AP Group or Template
true if the AP Group or Template is a shared
details.[ap_group|template].shared
resource. false otherw ise.
Number of devices allow ed to be configured in
details.device_limit
parallel for this job. 0 for no limit.
true if the configuration job should be stopped if an
details.stop_on_error
error occurs. false otherw ise.
devices.count Number of devices w ithin this job
devices.failed Number of devices that failed to be configured
devices.remaining Number of devices that are yet to be configured
devices.skipped Number of devices that w ere skipped
Number of devices that have been configured
devices.success
successfully
job_id Unique ID of this configuration job
display_id Job ID show n in cnmaestro UI
managed_account Account that created the job
Current state of job. “not_started”, “stopped”,
state
“complete”, “in_progress”, “aborted”
Job type. Currently only “configuration” is
type
available.

9.3.3 Example

Request
curl https://10.110.134.12/api/v1/jobs/1 \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"paging": {
"offset": 0,
"limit": 100,
"total": 1
},
"data": [
{
"completion_time": "2018-08-15T15:48:08+00:00",
"created_by": "Administrator",
"creation_time": "2018-08-15T15:42:51+00:00",
"description": "1 ePMP 1000 device(s)",
"details": {
"device_limit": 0,
"stop_on_error": false,
"template": {
"name": "ePMP timeout",
"managed_account": "",
"shared": true
}
},
"devices": {
"count": 1,
"failed": 1,
"remaining": 0,
"skipped": 0,
"success": 0
},
"job_id": 1,
"display_id": 1,
"managed_account": "",
"state": "complete",
"type": "configuration"

5/13/19 Page 35 of 71
}
]
}

9.4 GET Configuration Job Devices


Gets the device list of the specified job, including configuration attempt results.

GET /api/v1/jobs/{job_id}/devices

GET /api/v1/msp/managed_accounts/{msp_name}/jobs/{job_id}/devices

9.4.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

9.4.2 Response

Body

Name Details
job_id Unique ID of this configuration job
last_update_time Date/time of last message received from device.
mac MAC address of the device
managed_account Account that created the job
message Detailed description of device state.
name Name of the device
state Current configuration state of device.
status Current Online/offline status of the device

9.4.3 Example

Request
curl https://10.110.134.12/api/v1/jobs/1/devices \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"paging": {
"offset": 0,
"limit": 100,
"total": 1
},

5/13/19 Page 36 of 71
"data": [
{
"job_id": 1,
"last_update_time": "2018-08-15T15:48:08+00:00",
"mac": "00:04:56:C0:0C:7C",
"managed_account": "Your_MSP",
"message": "Device timed out while waiting for update",
"name": "Lab device 5",
"state": "failed",
"status": "offline"
}
]
}

10 Networks API
10.1 Fetch
GET /api/v1/networks

GET /api/v1/networks/{Network ID}

Retrieve inventory data from networks.

Note
If the MSP feature is enabled, only Networks in the Base Infrastructure can be individually
accessed through Network ID using this API. To access Networks mapped to a Managed Service
using Network ID, please use the Managed Service API.

10.1.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

Note
The Network ID may be replaced with the Network Name as long as the name is unique in the
system. If the name is not unique, an HTTP error code 422 (Unprocessable Entity) will be returned.

10.1.2 Response

Body

5/13/19 Page 37 of 71
Name Details
id Identifier of the netw ork.
managed_account Managed account name
name Name of the netw ork.

10.1.3 Example

Request
curl https://10.110.134.12/api/v1/networks \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"paging": {
"offset": 0,
"limit": 100,
"total": 4
},
"data": [
{
"id": "TEST_AUTOMATION_NETWORK",
"managed_account": "testmsp",
"name": "TEST_AUTOMATION_NETWORK"
},
{
"id": "default",
"managed_account": "",
"name": "default"
},
{
"id": "Automation",
"managed_account": "testmsp",
"name": "Automation"
},
{
"id": "test_net_1",
"managed_account": "testmsp",
"name": "test_net_1"
}
]
}

10.2 Create Network

Create a new network in cnMaestro.

POST /api/v1/networks
POST /api/v1/msp/managed_accounts/{msp_name}/networks

10.2.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

5/13/19 Page 38 of 71
Body Parameters

Header Value
name Netw ork of the new netw ork (required)

10.2.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

10.2.3 Example

Request
curl https://10.110.134.12/api/v1/networks \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "new-network-name"
}
Response
{
"message": "success"
}

10.3 Update Network


Update an existing network in cnMaestro.

PUT /api/v1/networks/{Network ID}


PUT /api/v1/msp/managed_accounts/{msp_name}/networks/{Network ID}

10.3.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body Parameters

Header Value
name Netw ork of the new netw ork (required)

10.3.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

10.3.3 Example

Request

5/13/19 Page 39 of 71
curl https://10.110.134.12/api/v1/networks/network-name \
-X PUT -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "new-network-name"
}
Response
{
"message": "success"
}

10.4 Delete Network


Deletes an existing network in cnMaestro.

DELETE /api/v1/networks/{Network ID}


DELETE /api/v1/msp/managed_accounts/{msp_name}/networks/{Network ID}

10.4.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

10.4.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

10.5 Sub-Resources
The following sub-resources can be applied to Network URLs.

Devices APIs of specific netw ork under Base


/api/v1/netw orks/{Network ID}/{Devices API}
Infrastructure.

11 Sites API
11.1 Overview

GET /api/v1/networks/{Network ID}/sites

GET /api/v1/networks/{Network ID}/sites/{Site ID}

Retrieve all sites or a specific site from a network of Base Infrastructure.

Note

5/13/19 Page 40 of 71
If the MSP feature is enabled, only Networks in the Base Infrastructure can be individually
accessed through Network ID using this API. To access Networks mapped to a Managed Service
using Network ID, please use the Managed Service API (defined later).

11.1.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).
start_time Sites created after specified start time. (ISO 8601 format)
stop_time Sites created before specified stop time. (ISO 8601 format)

Note
The Site ID may be replaced with the Site Name as long as the name is unique in the system. If the
name is not unique, an HTTP error code 422 (Unprocessable Entity) will be returned.

11.1.2 Response

Body

Name Details
created_at Site creation date and time
id Identifier of the site.
location Location of the site.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e.


managed_account=), devices not mapped to a managed account w ill be
returned (those in the base infrastructure).
name Name of the site.
network Netw ork to w hich the site belongs.

11.2 Create Site


Create a new Site.

POST /api/v1/networks/{Network ID}/sites


/api/v1/msp/managed_accounts/{msp_name}/networks{Network
POST
ID}/sites

11.2.1 Request

HTTP Headers

5/13/19 Page 41 of 71
Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body Parameters

Header Value
address Address of the site
latitude Geo location latitude
longitude Geo location longitude
name Name of the new site (required)

Note
If the Site already exists with given name then no duplicate Site will be created.

11.2.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

11.2.3 Example

Request
curl https://10.110.134.12/api/v1/networks/{Network_ID}/sites \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "new-site-name"
}
Response
{
"message": "success"
}

11.3 Update Site


Updates a Site.

PUT /api/v1/networks/{Network ID}/sites/{Site ID}


/api/v1/msp/managed_accounts/{msp_name}/networks{Network
PUT ID}/sites/{Site ID}

11.3.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

5/13/19 Page 42 of 71
Body Parameters

Header Value
address Address of the site
latitude Geo location latitude
longitude Geo location longitude
name Name of the new site

11.3.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

11.3.3 Example

Request
curl https://10.110.134.12/api/v1/networks/{Network_ID}/sites/site-name \
-X PUT -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "new-site-name"
}
Response
{
"message": "success"
}

11.4 Delete Site


Deletes a Site.

DELETE /api/v1/networks/{Network ID}/sites/{Site ID}


/api/v1/msp/managed_accounts/{msp_name}/networks{Network
DELETE ID}/sites/{Site ID}

11.4.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

11.4.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

11.5 Sub-Resources
The following sub-resources can be applied to Site URLs.

5/13/19 Page 43 of 71
Device APIs for a site under a netw ork of Base
/api/v1/netw orks/{NID}/sites/{SID}/{Devices API}
infrastructure

12 Towers API
12.1 Overview
GET /api/v1/networks/{Network ID}/towers

GET /api/v1/networks/{Network ID}/towers/{Tower ID}

Note
If the MSP feature is enabled, only Networks in the Base Infrastructure can be individually
accessed through Network ID using this API. To access Networks mapped to a Managed Service
using Network ID, please use the Managed Service API (defined later).

12.1.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

Note
The Tower ID may be replaced with the Tower Name as long as the name is unique in the system.
If the name is not unique, an HTTP error code 422 (Unprocessable Entity) will be returned.

12.1.2 Response

Body

Name Details
id Identifier of the tow er.
location Location of the tow er.
managed_account Managed account name
name Name of the tow er.
network Netw ork to w hich the tow er belongs.

12.2 Create Tower


Create a new Tower.

POST /api/v1/networks/{Network ID}/towers


/api/v1/msp/managed_accounts/{msp_name}/networks/{Network
POST ID}/towers

5/13/19 Page 44 of 71
12.2.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body Parameters

Header Value
latitude Geo location latitude
longitude Geo location longitude
name Name of the new tow er

Note
If the Tower already exists with given name then no duplicate Tower will be created.

12.2.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

12.2.3 Example

Request
curl https://10.110.134.12/api/v1/networks/{Network_ID}/towers \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "new-tower-name"
}
Response
{
"message": "success"
}

12.3 Update Tower


Updates a Tower.

POST /api/v1/networks/{Network ID}/towers/{Tower ID}


/api/v1/msp/managed_accounts/{msp_name}/networks/{Network
POST ID}/towers/{Tower ID}

12.3.1 Request

HTTP Headers

Header Value
Accept (optional) application/json

5/13/19 Page 45 of 71
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body Parameters

Header Value
latitude Geo location latitude
longitude Geo location longitude
name Name of the new tow er

12.3.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

12.3.3 Example

Request
curl https://10.110.134.12/api/v1/networks/{Network_ID}/towers/tower -name \
-X PUT -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"name": "new-tower-name"
}
Response
{
"message": "success"
}

12.4 Delete Tower


Deletes a Tower.

DELETE /api/v1/networks/{Network ID}/towers/{Tower ID}


/api/v1/msp/managed_accounts/{msp_name}/networks/{Network
DELETE ID}/towers/{Tower ID}

12.4.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

12.4.2 Response

The response will be either HTTP 200 (for success), or an HTTP error code with a JSON body (see
cnMaestro API User Guide for details).

12.5 Sub-Resources
The following sub-resources can be applied to Tower URLs.

5/13/19 Page 46 of 71
Device APIs of tow er under a netw ork of Base
/api/v1/netw orks/{NID}/tow ers/{TID}/{Devices API}
Infrastructure.

13 Statistics API
13.1.1 Overview

GET /api/v1/devices/statistics

GET /api/v1/devices/{MAC Address}/statistics

Retrieve statistics data from a resource (currently only devices are supported). Statistics parameters
can be used in tandem with parameters available for the resource.

13.1.2 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).
mode Device mode filter(ap/sm etc)
network Netw ork filter (text name of the netw ork).
tower Tow er filter(text name of the tow er)

13.1.3 Response

Body

Name Details ePMP PMP WiFi cnReach


General
ap_mac AP MAC SM SM
config_version Configuration version AP/SM AP/SM
connected_sms Connected SM count AP AP
distance SM distance (miles) SM SM
gain Antenna gain (dBi) AP/SM AP/SM
gps_sync_state GPS synchronization state AP/SM
Last synchronization (UTC
last_sync AP/SM AP/SM
Unix time milliseconds)
mac MAC address AP/SM AP/SM All
managed_account Managed account name AP/SM AP/SM All
Device mode
mode AP/SM AP/SM All
[ap, sm]
name Device name AP/SM AP/SM All
network Netw ork AP/SM AP/SM All

5/13/19 Page 47 of 71
parent_mac Parent MAC All
reboots Reboot count AP/SM
site Site name All
site_id Site unique identifier All
Status
status [online, offline,
AP/SM AP/SM All
claimed, waiting,
onboarding]
status_time Uptime/dow ntime interval (sec) AP/SM AP/SM All
temperature Temperature AP/SM
tower Tow er name AP AP
Device type
type [epmp, pmp, wifi-home, All
wifi-enterprise]
vlan VLAN AP/SM
Netw orks
default_gateway Default gatew ay AP/SM AP/SM All
ip_dns DNS AP/SM AP/SM All
ip_dns_secondary Secondary DNS AP/SM All
ip_wan WAN IP AP/SM All
LAN mode status
lan_mode_status AP/SM
[no-data, half, full]
lan_mtu MTU size SM
lan_speed_status LAN speed status AP/SM All
LAN status
lan_status AP/SM
[down, up]
netmask Netw ork mask AP/SM AP/SM All
Radios (Fixed Wireless)
radio.auth_mode Authentication mode AP/SM
Authentication type
ePMP
radio.auth_type [open, wpa1, eap-ttls] AP/SM
PMP:
[disabled, enabled]
Channel w idth
ePMP:
[5 MHz, 10 MHz, 20
radio.channel_width AP/SM AP/SM
MHz, 40 MHz]
PMP:
[…]
radio.color_code Color code AP/SM AP/SM
DFS status
ePMP:
[not-applicable,
channel-availability-
check, in-service,
radio.dfs_status radar-signal-detected, AP/SM AP/SM
alternate-channel-
monitoring, not-in-
service]
PMP:
[Status String]
radio.dl_frame_utilization Dow nlink frame utilization AP
radio.dl_mcs MCS SM
radio.dl_modulation Modulation SM
radio.dl_pkts Usage (packet count) AP/SM AP/SM
radio.dl_pkts_loss Dow nlink packet loss AP/SM
radio.dl_retransmits Retransmission AP/SM
radio.dl_retransmits_pct Retransmission percentage AP/SM
radio.dl_rssi RSSI SM SM
radio.dl_rssi_imbalance Dow nlink RSSI imbalance AP
radio.dl_snr SNR (dB) SM
radio.dl_snr_v Dow nlink SNR (dB) vertical SM
radio.dl_snr_h Dow nlink SNR (dB) horizontal SM

5/13/19 Page 48 of 71
radio.dl_throughput Dow nlink throughput AP
radio.frame_period Frame period AP
radio.frequency RF frequency AP/SM AP/SM
radio.mac Wireless MAC AP/SM
Radio mode
[eptp-master, eptp-
radio.mode AP/SM
slave, tdd, tdd-ptp,
ap/sm]
radio.sessions_dropped Session drops AP AP/SM
radio.ssid SSID AP/SM
radio.sync_source Synchronization source AP
radio.sync_state Synchronization state AP
TDD ratio
ePMP:
[75/25, 50/50, 30/70,
radio.tdd_ratio AP/SM AP/SM
flexible]
PMP:
[…]
radio.tx_capacity SM transmit capacity SM
radio.tx_power Radio transmit pow er AP/SM AP/SM
radio.tx_quality SM transmit quality SM
radio.ul_frame_utilization Uplink frame utilization AP
radio.ul_mcs Uplink MCS AP/SM
Modulation
radio.ul_modulation e.g. [2X MIMO-B)]
SM
radio.ul_pkts Usage (packet count) AP/SM AP/SM
radio.ul_pkts_loss Uplink packet loss AP/SM
radio.ul_retransmits Retransmission AP/SM
radio.ul_retransmits_pct Retransmission percentage AP/SM
radio.ul_rssi RSSI SM SM
radio.ul_snr SNR (dB) SM
radio.ul_snr_v Uplink SNR (dB) vertical SM
radio.ul_snr_h Uplink SNR (dB) horizontal SM
radio.ul_throughput Uplink throughput AP
WLAN status
radio.wlan_status AP/SM
[down, up]
Radios (WiFi)
radio.24ghz.airtime Airtime All
radio.24ghz.bssid Radio mac Enterprise
radio.24ghz.channel Channel All
radio.24ghz.multicast_rate Multicast rate All
radio.24ghz.noise_floor Noise floor All
radio.24ghz.num_clients Number of clients All
radio.24ghz.num_wlans Number of WLANs Enterprise
radio.24ghz.power Transmit pow er All
radio.24ghz.quality RF Quality description Enterprise
radio.24ghz.radio_state Radio state Enterprise
radio.24ghz.rx_bps Receive bits/second Enterprise
radio.24ghz.rx_bytes Receive bytes All
radio.24ghz.tx_bps Transmit bits/second Enterprise
radio.24ghz.tx_bytes Transmit bytes All
radio.24ghz.unicast_rates Unicast rates All
radio.24ghz.utilization Radio utilization Enterprise
radio.5ghz.airtime Airtime All
radio.5ghz.bssid Radio mac Enterprise
radio.5ghz.channel Channel Enterprise
radio.5ghz.multicast_rate Multicast rate All
radio.5ghz.noise_floor Noise floor All
radio.5ghz.num_clients Number of clients Enterprise
radio.5ghz.num_wlans Number of WLANs Enterprise
radio.5ghz.power Transmit pow er All
radio.5ghz.quality RF quality description Enterprise
radio.5ghz.radio_state Radio state Enterprise
radio.5ghz.rx_bps Receive bits/second Enterprise

5/13/19 Page 49 of 71
radio.5ghz.rx_bytes Receive bytes All
radio.5ghz.tx_bps Transmit bits/second Enterprise
radio.5ghz.tx_bytes Transmit bytes All
radio.5ghz.unicast_rates Unicast rates All
radio.5ghz.utilization Radio utilization Enterprise
Radios (cnReach)
radio.radio1.margin Margin Radios
Radio mode
radio.radio1.mode Radios
[ap, ep, rep]
radio.radio1.neighbors Radio neighbors Radios
radio.radio1.noise Average noise (dB) Radios
radio.radio1.power Transmit pow er Radios
radio.radio1.rssi RSSI value (dB) Radios
radio.radio1.rx_bytes Receive bytes Radios
radio.radio1.software_version Current softw are version. Radios
radio.radio1.temperature Radio temperature Radios
radio.radio1.tx_bytes Transmit bytes Radios
Radio type Radios
radio.radio1.type
[ptp, pmp]
radio.radio1.vlan Connected VLAN ID. Radios
radio.radio2.margin Margin Radios
Radio mode
radio.radio2.mode Radios
[ap, ep, rep]
radio.radio2.neighbors Radio neighbors Radios
radio.radio2.noise Average noise Radios
radio.radio2.power Transmit pow er Radios
radio.radio2.rssi RSSI value (dB) Radios
radio.radio2.rx_bytes Receive bytes Radios
Radio current softw are
radio.radio2.software_version Radios
version.
radio.radio2.temperature Radio temperature Radios
radio.radio2.tx_bytes Transmit bytes Radios
Radio type
radio.radio2.type Radios
[ptp, pmp]
radio.radio2.vlan Connected VLAN id. Radios
Interfaces (cnReach)
interface.default_gateway Interface gatew ay All
interface.mac Interface MAC address All
interface.name Interface name (vlan1, rad1) All
interface.ip Interface IP Address All
interface.ip_dns Interface DNS1 IP address All
interface.netmask Interface mask All

14 Performance API
14.1.1 Device

GET /api/v1/devices/performance

GET /api/v1/devices/{MAC Address}/performance

Retrieve performance data from a resource (currently only devices are supported). Performance
parameters can be used in tandem with parameters available for the resource.

14.1.2 Request

HTTP Headers

Header Value
Accept (optional) application/json

5/13/19 Page 50 of 71
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
Pagination functionality.(These limit and offset are for devices(MACs) and not for
limit, offset
metrics objects count in the response)
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).
start_time Start time for performance data in ISO 8601 format.
stop_time Stop time for performance data in ISO 8601 format.

14.1.3 Response

Body

Name Details ePMP PMP WiFi cnReach


General
mac MAC address AP/SM AP/SM All All
managed_account Managed account name AP/SM AP/SM All All
mode Device mode AP/SM AP/SM All All
name Device name AP/SM AP/SM All All
network Netw ork AP/SM AP/SM All All
Duration of device connection
online_duration AP/SM AP/SM All All
w ith server ( in seconds )
site Site All All
sm_count Connected SM count AP AP
sm_drops Session drops AP/SM AP
timestamp Timestamp AP/SM AP/SM All All
tower Tow er AP AP All
Device type
type [epmp, pmp, wifi-home, AP/SM AP/SM All All
wifi-enterprise]
Device online time ( in
uptime AP/SM AP/SM All All
seconds )
Radios (Fixed Wireless)
radio.dl_frame_utilization Frame utilization AP
Usage (in kbits on hour or
radio.dl_kbits AP/SM
minute basis)
radio.dl_mcs MCS SM
radio.dl_modulation Modulation SM
radio.dl_pkts Usage (packet count) AP/SM
radio.dl_pkts_loss Dow nlink packet loss AP/SM
radio.dl_retransmits_pct Retransmission percentage AP/SM
radio.dl_rssi RSSI SM SM
radio.dl_rssi_imbalance RSSI imbalance SM
radio.dl_snr SNR SM
radio.dl_snr_v Dow nlink SNR (dB) vertical SM
radio.dl_snr_h Dow nlink SNR (dB) horizontal SM
radio.dl_throughput Throughput (Kbps) AP/SM AP/SM All
radio.ul_frame_utilization Frame utilization AP
Usage (in Kbits on hour or
radio.ul.kbits AP/SM
minute basis)
radio.ul_mcs MCS SM
radio.ul_modulation Modulation SM
radio.ul_pkts Usage (packet count) AP/SM
radio.ul_pkts_loss Uplink packet loss AP/SM
radio.ul_retransmits_pct Retransmission percentage AP/SM

5/13/19 Page 51 of 71
radio.ul_rssi RSSI SM SM
radio.ul_snr SNR SM
radio.ul_snr_v Uplink SNR (dB) vertical SM
radio.ul_snr_h Uplink SNR (dB) horizontal SM
radio.ul_throughput Throughput (Kbps) AP/SM AP/SM All
Radios (WiFi)
radio.24ghz.clients Number of clients All
radio.24ghz.rx_bps Receive bits/second Enterprise
radio.24ghz.throughput Total throughput All
radio.24ghz.tx_bps Transmit bits/second Enterprise
radio.5ghz.clients Number of clients All
radio.5ghz.rx_bps Receive bits/second Enterprise
radio.5ghz.throughput Total throughput All
radio.5ghz.tx_bps Transmit bits/second Enterprise
Radios (cnReach)
radio.radio1.children Number of children Radios
radio.radio1.neighbors Radio neighbors Radios
radio.radio1.noise Average noise Radios
radio.radio1.power Transmit pow er Radios
radio.radio1.rssi RSSI value Radios
radio.radio1.rx_bytes Receive bytes Radios
radio.radio1.throughput Total throughput Radios
radio.radio1.tx_bytes Transmit bytes Radios
radio.radio2.children Number of children Radios
radio.radio2.neighbors Radio neighbors Radios
radio.radio2.noise Average noise Radios
radio.radio2.power Transmit pow er Radios
radio.radio2.rssi RSSI value Radios
radio.radio2.rx_bytes Receive bytes Radios
radio.radio2.throughput Total throughput Radios
radio.radio2.tx_bytes Transmit bytes Radios

15 WiFi APIs
15.1 WiFi Clients
GET /api/v1/devices/clients

GET /api/v1/devices/{MAC Address}/clients/{Client MAC}

Retrieve data for WiFi Clients. This API only works with cnPilot Enterprise and cnPilot Home.

15.1.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

5/13/19 Page 52 of 71
15.1.2 Response

Body

Name Details WiFi


ap_mac AP MAC
ip IP address of client
mac Client MAC
managed_account Managed account name
manufacturer Manufacturer name
name Client name
radio.band Band (2.4 GHz /5 GHz)
radio.rssi RSSI
radio.rx_bytes Received bytes
radio.snr SNR
radio.ssid SSID
radio.tx_bytes Transmitted bytes
user Name of the user getting authenticated

15.2 WiFi Mesh Peers


GET /api/v1/devices/mesh/peers

GET /api/v1/devices/mesh/peers/{Peer MAC}

GET /api/v1/devices/{MAC Address}/mesh/peers/{Peer MAC}

Retrieve all Wi-Fi Peers data or a specific peer data or a peers of an AP. This API only works with
cnPilot Enterprise.

15.2.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

15.2.2 Response

Body

Name Details
Mesh Base AP
ap.base_mac Mesh Base MAC address
ap.description AP description
ap.last_sync AP last synchronization time
ap.mac AP MAC address

5/13/19 Page 53 of 71
ap.name AP hostname
ap.site Site to w hich the AP belongs
ap.status Status of AP (online/offline)
ap.status_time Duration since the AP is online or offline
ap.24ghz.airtime Airtime utilization on 2.4 GHz radio in percentage (%)
ap.24ghz.noise_floor Noise floor of 2.4 GHz radio
ap.24ghz.rx_bytes Total received bytes on 2.4 GHz radio
ap.24ghz.tx_bytes Total transmitted bytes on 2.4 GHz radio
ap.5ghz.airtime Airtime utilization on 5 GHz radio in percentage (%)
ap.5ghz.noise_floor Noise floor of 5 GHz radio
ap.5ghz.rx_bytes Total received bytes on 5 GHz radio
ap.5ghz.tx_bytes Total transmitted bytes on 5 GHz radio
Mesh Peer
ip Mesh Peer IP address
mac Mesh Peer MAC address
managed_account Managed account name
name Mesh Peer hostname
Radio (Mesh Peer)
radio.band Mesh Peer radio band
radio.data_rate Data rate in Mbps
radio.rssi Mesh Peer RSSI
radio.rx_bytes Total received bytes
radio.snr Mesh Peer SNR
radio.ssid Mesh Peer SSID
radio.tx_bytes Total transmitted bytes

15.2.3 Example

Request
curl https://10.110.134.134/api/v1/devices/mesh/peers/BC-62-9F-05-37-61 \
-X GET -k \
-H "Authorization: Bearer 6b2a1954bf8fd13a93a8772247876d6ace65b304 "
Response
{
"paging": {
"limit": 100,
"total": 1
},
"data": [
{
"ip": "10.110.235.73",
"mac": "BC-62-9F-05-37-61",
"managed_account": "testmsp",
"name": "",
"ap": {
"mac": "00:04:56:B6:74:14",
"base_mac": "00-04-56-B6-86-22",
"name": "E400-B67414",
"description": "Base AP For Demo",
"site": "Central",
"up_time": "0d 5h 38m",
"24ghz": {
"noise_floor": "-94",
"airtime": "72/4/68/0",
"tx_bytes": 5464,
"rx_bytes": 3360
},
"5ghz": {
"noise_floor": "-104",
"airtime": "4/0/4/0",
"tx_bytes": 574,
"rx_bytes": 34860
}
},

5/13/19 Page 54 of 71
"radio": {
"band": "2.4GHz",
"rssi": -46,
"snr": 54,
"ssid": "Auto-RF-2G-new",
"tx_bytes": 573464,
"rx_bytes": 349360,
"data_rate": 72.109
}
}
]
}

15.2.4 Sub-Resources

The following sub-resources can be applied to Mesh Peer URLs.

/api/v1/devices/m esh/peers/end_hosts/{End Host MAC} End Host connected to a Mesh Peer.

15.2.4.1 Response

Body

Name Details
Mesh Base AP
ap.base_mac Mesh Base MAC Address
ap.description AP description
ap.ip AP IP address
ap.mac AP MAC address
ap.name AP hostname
ap.site Site to w hich the AP belongs
ap.24ghz.airtime Airtime utilization on 2.4 GHz radio in percentage (%)
ap.24ghz.noise_floor Noise floor of 2.4 GHz radio
ap.24ghz.rx_bytes Total received bytes on 2.4 GHz radio
ap.24ghz.tx_bytes Total transmitted bytes on 2.4 GHz radio
ap.5ghz.airtime Airtime utilization on 5 GHz radio in percentage (%)
ap.5ghz.noise_floor Noise floor of 5 GHz radio
ap.5ghz.rx_bytes Total received bytes on 5 GHz radio
ap.5ghz.tx_bytes Total transmitted bytes on 5 GHz radio
Mesh Peer
ip Mesh Peer IP address
mac Mesh Peer MAC address
managed_account Managed account name
name Mesh Peer hostname
Radio (Mesh Peer)
radio.band Mesh Peer radio band
radio.data_rate Data rate in Mbps
radio.rx_bytes Total received bytes
radio.rssi Mesh Peer RSSI
radio.snr Mesh Peer SNR
radio.ssid Mesh Peer SSID
radio.tx_bytes Total transmitted bytes

15.2.4.2 Example

Request
curl https://10.110.134.134/api/v1/devices/mesh/peers/end_hosts /00-04-56-0F-A4-D9 \
-X GET -k \
-H "Authorization: Bearer 6b2a1954bf8fd13a93a8772247876d6ace65b304 "
Response
{

5/13/19 Page 55 of 71
"paging": {
"limit": 100,
"total": 1
},
"data": [
{
"ip": "10.110.235.73",
"mac": "BC-62-9F-05-37-61",
"managed_account": "testmsp",
"name": "",
"ap": {
"mac": "00:04:56:B6:74:14",
"base_mac": "00-04-56-B6-86-22",
"name": "E400-B67414",
"description": "Base AP For Demo",
"site": "Central",
"up_time": "0d 5h 38m",
"24ghz": {
"noise_floor": "-94",
"airtime": "72/4/68/0",
"tx_bytes": 5464,
"rx_bytes": 3360
},
"5ghz": {
"noise_floor": "-104",
"airtime": "4/0/4/0",
"tx_bytes": 574,
"rx_bytes": 34860
}
},
"radio": {
"band": "2.4GHz",
"rssi": -46,
"snr": 54,
"ssid": "Auto-RF-2G-new",
"tx_bytes": 573464,
"rx_bytes": 349360,
"data_rate": 72.109
}
}
]
}

15.3 WiFi Clients Summary


GET /api/v1/devices/{MAC Address}/clients/summary

GET /api/v1/devices/{MAC Address}/clients/{Client MAC}/summary

Retrieve aggregated data for WiFi Clients which got updated in last 24 hours. This API only works
with cnPilot Enterprise and cnPilot Home.

15.3.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.

5/13/19 Page 56 of 71
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).

15.3.2 Response

Body

Name Details
mac Client MAC
rx_bytes Aggregated Received bytes
session_duration Aggregated duration (in seconds)
tx_bytes Aggregated Transmitted bytes

15.3.3 Example

Request
curl https://10.110.134.134/api/v1/devices/00:04:56:BD:82:B8/clients/summary \
-X GET -k \
-H "Authorization: Bearer 6b2a1954bf8fd13a93a8772247876d6ace65b304 "
Response
{
"paging": {
"limit": 100,
"total": 1
},
"data": [
{
"mac": "7C:6B:9C:21:DB:F5",
"tx_bytes": 61147,
"rx_bytes": 32236,
"session_duration": 923407
},
{
"mac": "D8:32:E3:74:19:0D",
"tx_bytes": 6306416,
"rx_bytes": 876230,
"session_duration": 2755991
}
]
}

16 Alarms API
16.1 Active Alarms
GET /api/v1/alarms

Retrieve active alarm data.

16.1.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

5/13/19 Page 57 of 71
Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).
severity Alarm severity [critical, major, minor]

16.1.2 Response

Body

Name Details
acknowledged_by Acknow ledged by
code Category code
duration Duration (seconds)
id Alarm Id
mac MAC address
managed_account Managed account name
message Message
name Alarm name
network Netw ork
severity Severity
site Site
source Device name
source_type Device type
status Status
time_raised Raised time
tower Tow er

16.2 Alarm History


GET /api/v1/alarms/history

Retrieve active and historical alarm data including Base infrastructure and all managed accounts.

16.2.1 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


then devices not mapped to a managed account w ill be returned (essentially those in
the base infrastructure).
severity Alarm severity [critical, major, minor]
start_time Start time of the interval w here the alarms are active (ISO 8601 format).

5/13/19 Page 58 of 71
state Alarm state (active, cleared).
stop_time Stop time of the interval w here the alarms are active (ISO 8601 format).

16.2.2 Response

Body

Name Details
acknowledged_by Acknow ledged by
code Category code
duration Duration (seconds)
id Alarm Id
mac MAC address
managed_account Managed account name
message Message
name Alarm name
network Netw ork
severity Severity
site Site
source Device name
source_type Device type
status Status
time_cleared Clear time
time_raised Raised time
tower Tow er

17 Events API
17.1.1 Overview

GET /api/v1/events

Retrieve event log from all managed accounts including Base infrastructure.

Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


devices not mapped to a managed account w ill be returned (those in the base
infrastructure).
severity Alarm severity (critical, major, minor).
start_time Start time of the event generation timestamp (ISO 8601 format).
stop_time Stop time of the event generation timestamp (ISO 8601 format).
code Event category code ( "CFG_UPD_ST", "DFS_ST", "GPS_SYNC_ST",
"GPS_FW_UPD_ST", "GPS_VER", "LINK_ST", "METRIC_RA TELIMIT",
"EVENT_RATELIMIT", "CLIENT_EV ENT_RATELIMIT", "CFG_IMP", "CFG_EXP",

5/13/19 Page 59 of 71
"CONFIG_SYNC", "FW_UPD_ST", "STA_REG", "STA_DROP", "SYS_UP",
"SYS_REB", "SA_MODE", "STATUS", "ONBOARDING", "GPS_SYNC",
"RADAR_DETECT", "REGULATORY_FAIL", "RF_OVER_LOA D",
"DHCP_CLIENT_IP", "STA_REG_FA IL", "DEF_KEY_USED_TRA P", "WIFI_CONN",
"WIFI_DISC", "WIFI_MESH_DISC", "SITE_SW_SY NC", "THRESH_CPU_UTIL",
"THRESH_CLIENT_COUNT", "THRESH_DEV ICE_TRAFFIC",
"WIFI_CLIENT_DISCONNECTED", "WIFI_CLIENT_CONNECTED",
"WEAK_ADMIN_PWD", "SYSTEM_CONFIG_A PPLIED" )

Response

Body

Name Details
code Category code
id Unique event Id
mac MAC address
managed_account Managed account name
message Message
name Event name
network Netw ork
severity Severity
site Site
source Device name
source_type Device type
time_raised Raised time
tower Tow er

18 Sessions API
18.1.1 Overview

GET /api/v1/users/sessions

Retrieve the session information for current user sessions normal account login.

Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=), or


this parameter is not passed in the url then devices not mapped to a managed account
w ill be returned (those in the base infrastructure).

Response

Body

5/13/19 Page 60 of 71
Name Details
duration Duration of session in seconds
id Session Id
managed_account Managed account name
role Role of the administrator
user User name of the administrator

19 Guest Access Portal API


19.1 List of Guest Access Portals
19.1.1 Overview

GET /api/v1/portals

GET /api/v1/portals/{portal id}

Display the current Guest Access Portals of Base Infrastructure in cnMaestro and the id used to
reference them. Note Portals first need to be created through the Web UI in order to be visible through
the API.

Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


or this parameter is not passed in the url then devices not mapped to a managed
account w ill be returned (those in the base infrastructure).

Response

Body

Name Details
id Id of guest access portal
managed_account Managed account name
name Name of guest access portal
whitelist List of w hitelisted domains

19.1.2 Example

Request
curl https://10.110.134.12/api/v1/portals \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response

5/13/19 Page 61 of 71
{
"paging": {
"offset": 0,
"limit": 100,
"total": 2
},
"data": [{
"id": "default",
"name": "default",
“managed_account”: “”,
"whitelist": ["cloud.cambiumnetworks.com", "cloud.company.com"]
},
{
"id": "portal_net_1",
"name": "portal_net_1",
“managed_account”: “testmsp”,
"whitelist": ["microsoft.com", "57.34.34.23"]
}
]
}

19.2 Update Whitelist on Guest Access Portal


19.2.1 Overview

PUT /api/v1/portals/{Portal ID}/whitelist

Update the whitelist in a Guest Access Portal under Base infrastructure. Note that the API requires
the full whitelist to be replaced with the new one.

19.2.2 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body

Name Details
whitelist Array of w hitelisting domains as url encoded string

19.2.3 Example

Below example show the curl command to update the whitelist of portal_net_1 portal with
[“google.com”, “yahoo.com”]

Request
curl https://10.110.134.12/api/v1/portals/portal_net_1/whitelist \
-X PUT -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"whitelist": [“www.google.com”, “www.yahoo.com”]
}
Response
{

5/13/19 Page 62 of 71
"data": {
"result": "Successfully updated guest access portal - portal_net_1"
}
}

Note
Only updating the whitelist field of the Portal object will be supported.

19.3 List of Vouchers


19.3.1 Overview

GET /api/v1/portals/{Portal ID}/vouchers/{voucher plan}

Display the current vouchers list under a plan. Note Portals and plans first need to be created through
the Web UI in order to be visible through the API.

19.3.2 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


or this parameter is not passed in the url then devices not mapped to a managed
account w ill be returned (those in the base infrastructure).
limit, offset Pagination functionality.

Response

Body

Name Details
voucher_code Voucher code
creation_time Creation time
expiry Expiry time
plan_name Plan name
status Status of voucher (unclaimed, claimed, expired)

19.3.3 Example
Below example show the curl command to get vouchers under portal_net_1 portal and plan_1 plan.

Request
curl https://10.110.134.12/api/v1/portals/portal_net_1/vouchers/plan_1 \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"data": {

5/13/19 Page 63 of 71
"paging": {
"offset": 0,
"limit": 100,
"total": 2
},
"data": [
{
"voucher_code": "KWGQQ3C1",
"creation_time": "2018-05-11T07:50:01.654764Z",
"expiry": "2018-05-11T08:00:01+00:00",
"plan_name": "plan_1",
"status": "expired"
},
{
"voucher_code": "4RZR9D1F",
"creation_time": "2018-05-11T07:50:01.654764Z",
"expiry": "2018-05-11T08:00:01+00:00",
"plan_name": " plan_1",
"status": "expired"
}
]
}
}

19.4 Generate Vouchers


19.4.1 Overview

POST /api/v1/portals/{Portal ID}/vouchers/{voucher plan}/generate

Generate voucher under a portal and specified plan. Note Portals and plans first need to be created
through the Web UI.

19.4.2 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>
Content-Type application/json

Body

Name Details
count Quantity of vouchers to be generate

19.4.3 Example
Below example show the curl command to generate 2 vouchers under portal_net_1 portal and
plan_1 plan.

Request
curl https://10.110.134.12/api/v1/portals/portal_net_1/vouchers/plan_1/generate \
-X POST -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Body
{
"count": 2

5/13/19 Page 64 of 71
}
Response
{
"data": {
"paging": {
"offset": 0,
"limit": 2,
"total": 12
},
"data": [
{
"voucher_code": "LMRR7ZBS",
"creation_time": "2019-03-15T05:41:40.619842Z",
"expiry": "2019-03-15T05:51:40+00:00",
"plan_name": "plan_1 ",
"status": "unclaimed"
},
{
"voucher_code": "RMWWD62Q",
"creation_time": "2019-03-15T05:41:40.619842Z",
"expiry": "2019-03-15T05:51:40+00:00",
"plan_name": "plan_1",
"status": "unclaimed"
}
]
}
}

19.5 List of Login events


19.5.1 Overview

GET /api/v1/portals/{Portal ID}/events

Display the current client login events. Note Portals first need to be created through the Web UI.

19.5.2 Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
Managed account name filter.

managed_account Only relevant if MSP is enabled. If no name is specified (i.e. managed_account=),


or this parameter is not passed in the url then devices not mapped to a managed
account w ill be returned (those in the base infrastructure).
limit, offset Pagination functionality.

Response

Body

Name Details
access_type Type of connection (Free, Paid)

5/13/19 Page 65 of 71
ap_mac Access point MAC
client_mac Client MAC
email Email used to login
login_time Login time
mobile_number Mobile number used to login
portal_name Portal name
ssid WLAN SSID of AP
voucher_code Voucher code

19.5.3 Example

Below example show the curl command to get vouchers under portal_net_1 portal and plan_1 plan.

Request
curl https://10.110.134.12/api/v1/portals/portal_net_1/events \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"data": {
"paging": {
"offset": 0,
"limit": 100,
"total": 2
},
"data": [
{
"ap_mac": "00:04:56:B5:5F:DC",
"client_mac": "C0-CC-F8-F0-B7-06",
"login_time": "2019-03-12T08:11:00.258Z",
"access_type": "Free",
"portal_name": "portal_net_1",
"voucher_code": "",
"ssid": "wlan_1",
"email": "",
"mobile_number": ""
},
{
"ap_mac": "00:04:56:B5:5F:DC",
"client_mac": "C0-CC-F8-F0-B7-06",
"login_time": "2019-03-12T08:11:00.258Z",
"access_type": "Free",
"portal_name": " portal_net_1",
"voucher_code": "",
"ssid": "wlan_1",
"email": "",
"mobile_number": ""
}
]
}
}

20 Managed Accounts API


20.1.1 Overview

GET /api/v1/msp/managed_accounts

GET /api/v1/msp/managed_accounts/{Account Name}/{Devices API}

5/13/19 Page 66 of 71
This API is only available if MSP is enabled. Access all Managed Accounts, or filter APIs by Managed
Account. See Sub-Resources section at end for a full listing of supported APIs.

Request

HTTP Headers

Header Value
Accept (optional) application/json
Authorization Bearer <ACCESS_TOKEN>

Parameters

Header Value
fields Select JSON fields to be returned.
limit, offset Pagination functionality.

Response

Body

Name Details
managed_account Managed account name
status Status(enabled/disabled) of the managed account

20.1.2 Example

Below example show the curl command to get all the managed accounts from the system

Request
curl https://10.110.134.12/api/v1/managed_accounts \
-X GET -k \
-H "Authorization: Bearer ee4e077cf457196eb4d27cf6f02686dc07763059"
Response
{
"paging": {
"offset": "0",
"limit": "100",
"total": 2
},
"data": [
{
"managed_account ": "test1msp",
“status”:”enabled”
},
{
"managed_account ": "test2msp2a"
“status”: “disabled”
}
]
}

20.2 Sub-Resources
The following sub-resources can be applied to Managed Services URLs.

/api/v1/m sp/m anaged_accounts/{account_nam e}/{Alarms API} Managed Service Alarms.


/api/v1/m sp/m anaged_accounts/{account_nam e}/{Clients API} Managed Service Clients.

5/13/19 Page 67 of 71
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Mesh Peers API} Managed Service Mesh Peers.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Devices API} Managed Service Devices.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Events API} Managed Service Events.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Networks API} Managed Service Netw orks.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Performance Managed Service Performance
API} Data.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Portals API} Managed Service Wi-Fi Portals.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Sessions API} Managed Service Admin Sessions.
/api/v1/m sp/m anaged_accounts/{account_nam e}/{Statistics API} Managed Service Statistics Data.

21 Sample Python Code


21.1 API Client
To execute the client, type the command below. The code is for Python 2.7, and may require the
python2.7 command in Linux.

python client.py

21.2 Code
# Copyright (C) 2017 Cambium Networks, LTD. All rights reserved.
#
# API test code for cnMaestro that demonstrates session establishment and API
# calls. The client connects to cnMaestro using the Client Id and Client
# Secret downloaded from the Client API page in the cnMaestro UI. The Client
# receives a URL, Access Token, and Expiration Interval (in seconds)
# defining how long the token is valid. The URL and Access Token are used
# for subsequent API requests.
#
# This example also demonstrates the Token Validation API, which connects to
# cnMaestro directly, and not necessarily the URL returned during session
# establishment (though in On-Premises, they will be identical).
#

import sys
import requests
import json
import base64

HOST = '10.10.10.10'
CLIENT_ID = 'b3hmeraj3Xse24Qj'
CLIENT_SECRET = 'oCrhxTwqQ34O2E6pCLXMq9dEs8tzPL'

# Simple HTTP return function. Exit script on error.


def check_http_return(section, url, code, request):
if int(code) != 200:
print '%s failed with HTTP status %d' % (section, code)
print 'URL: %s' % url
try:
print json.dumps(request.json(), indent=2)
except: pass
sys.exit(1)

# Retrieve access parameters (url, access_token, and expires_in).


def get_access_parameters(host, client_id, client_secret):
token_url = 'https://%s/api/v1/access/token' % host
encoded_credentials = base64.b64encode("%s:%s" % (client_id, client_secret))
headers = {
'Authorization': 'Basic %s' % encoded_credentials,
'Content-Type':'application/x-www-form-urlencoded'
}
body = 'grant_type=client_credentials'
r = requests.post(token_url, body, headers=headers, verify=False)
check_http_return('Access Parameters', token_url, r.status_code, r)
return r.json()['access_token'], r.json()['expires_in']

5/13/19 Page 68 of 71
# Validate the expiration of the access token.
def validate_access_token(host, access_token):
validate_url = 'https://%s/api/v1/access/validate_token' % (host)
headers = {
'Authorization': 'Bearer %s' % access_token,
}
r = requests.get(validate_url, headers=headers, verify=False)
check_http_return('Validate Access Token', validate_url, r.status_code, r)
return r.json()['expires_in']

# Execute API using URL returned in access parameters.


def call_api(host, path, access_token):
api_url = 'https://%s%s' % (host, path)
headers = {
'Authorization': 'Bearer %s' % access_token,
}
r = requests.get(api_url, headers=headers, verify=False)
check_http_return("API", api_url, r.status_code, r)
return r.json()

# Main function.
if __name__== '__main__':
# Retrieve access parameters and generate API session
print '\nRetrieve Access Parameters'
access_token, expires_in = get_access_parameters(HOST, CLIENT_ID, CLIENT_SECRET)
print 'Success: access_token (%s) expires_in (%s)\n' % (access_token, expires_in)

# Validate time remaining for the access token


print 'Validating expiration time'
expires_in_check = validate_access_token(HOST, access_token)
print 'Success: expiresIn (%s)\n' % (expires_in_check)

# Execute a basic API call


print ('Sending an API message')
#data = call_api(HOST, '/api/v1/alarms', access_token)
data = call_api(HOST, '/api/v1/devices', access_token)
#data = call_api(HOST, '/api/v1/devices/statistics', access_token)
#data = call_api(HOST, '/api/v1/events', access_token)
#data = call_api(HOST, '/api/v1/networks', access_token)
#data = call_api(HOST, '/api/v1/sites', access_token)
#data = call_api(HOST, '/api/v1/devices/statistics?fields=mac,type,ip_wan',
access_token)
if data: print json.dumps(data, indent=2)

22 Appendix: API List


This appendix lists the supported APIs.

Path Details
Alarm s API
/api/v1/alarms All active alarms.
/api/v1/alarms/{Alarm ID} Single active alarm (not supported)
/api/v1/alarms/history All historical and active alarms.
/api/v1/alarms/history/{Alarm ID} Single historical or active alarm. (not supported)

Clients API
/api/v1/devices/clients All clients
/api/v1/devices/{MAC Address}/clients/{client MAC} Clients connected a specific device
/api/v1/devices/{MAC Address}/clients/summary Aggregated data for all Wi -Fi clients
/api/v1/devices/{MAC Address}/clients/{client MAC}/summary Aggregated data for a single client

Devices API
/api/v1/devices System device inventory; claim new device
/api/v1/devices/{Alarms API} System device alarms
/api/v1/devices/{Clients API} System WiFi clients
/api/v1/devices/{Events API} System device events
/api/v1/devices/{Mesh API} System WiFi mesh peers.
/api/v1/devices/statistics System device statistics
/api/v1/devices/performance System device performance
/api/v1/devices/{MAC Address} Single device inventory; update device

5/13/19 Page 69 of 71
/api/v1/devices/{MAC Address}/{Alarms API} Single device alarms
/api/v1/devices/{MAC Address}/{Clients API} Single device WiFi clients
/api/v1/devices/{MAC Address}/{Ev ents API} Single device events
/api/v1/devices/{MAC Address}/{Mesh API} Single device WiFi mesh peers
/api/v1/devices/{MAC Address}/reboot Single device reboot operation
/api/v1/devices/{MAC Address}/statistics Single device statistics
/api/v1/devices/{MAC Address}/performance Single device performance

Events API
/api/v1/events All events.

Jobs API
/api/v1/jobs/{job_id} Configuration job management
/api/v1/jobs/{job_id}/devices Configuration job management

Managed Service API


/api/v1/msp/managed_accounts All Managed Accounts.
/api/v1/msp/managed_accounts/{account_name}/{Alarms API} Managed Service Alarms.
/api/v1/msp/managed_accounts/{account_name}/{Clients API} Managed Service Clients.
/api/v1/msp/managed_accounts/{account_name}/{Devices API} Managed Service Devices.
/api/v1/msp/managed_accounts/{account_name}/{Events API} Managed Service Events.
/api/v1/msp/managed_accounts/{account_name}/{Networks API} Managed Service Networks.
/api/v1/msp/managed_accounts/{account_name}/{Performance API} Managed Service Performance Data.
/api/v1/msp/managed_accounts/{account_name}/{Portals API} Managed Service Wi -Fi Portals.
/api/v1/msp/managed_accounts/{account_name}/{Sessions API} Managed Service Admin Sessions.
/api/v1/msp/managed_accounts/{account_name}/{Statistics API} Managed Service Statistics Data.

Mesh API
/api/v1/devices/mesh/peers All mesh peers
/api/v1/devices/mesh/peers/{peer mac} Specific mesh peer
/api/v1/devices/{MAC Address}/mesh/peers/{peer mac} Mesh peers connected to a specific device

Netw orks API


/api/v1/networks System network inventory; create new network
/api/v1/networks/{NID} Single network inventory
/api/v1/networks/{NID}/[Dev ices API] Single network devices

Portals API
/api/v1/portals All clients
/api/v1/portals/{portal id} Clients connected a specific device
PUT request to update the whitelist for a particular
/api/v1/portals/{portal id}/whitelist
portal

Sessions API
/api/v1/users/sessions All user sessions

Sites API
/api/v1/networks/{NID}/sites System site inventory; create new site
/api/v1/networks/{NID}/sites/{SID} Single site inventory
/api/v1/networks/{NID}/sites/{SID}/[Dev ices API] Single site devices

Tow ers API


/api/v1/networks/{NID}/towers System towers inventory; create new tower
/api/v1/networks/{NID}/towers/{TID} Single tower inventory
/api/v1/networks/{NID}/towers/{TID}/[Dev ices API] Single tower devices

23 Appendix: Device Details


23.1 Reboot Reason
Code Reason
DEV_CFG_UPD Admin initiated configuration update from device GUI or CLI (future)
DEV_SW_UPD Admin initiated softw are update from device GUI or CLI (future)

5/13/19 Page 70 of 71
DEV_REBOOT Admin initiated reboot from CLI or GUI (future)
DEV_REBOOT_CLI Admin initiated reboot from device CLI (E series only)
DEV_REBOOT_GUI Admin initiated reboot from device GUI (E series only)
DEV_FACTORY_RESET Admin initiated from device GUI or CLI (E series only)
DEV_SYSTEM_FAIL URE Internal System failure
DEV_LOW_MEM Low memory (E series only)
DEV_REBOOT_SCHEDUL ED Device Scheduled Reboot
DEV_REBOOT_KERNEL_PANIC Kernel Panic Reboot
SRV_REBOOT cnMaestro initiated reboot
SRV_SW_UPD cnMaestro initiated softw are update reboot
SRV_CFG_UPD cnMaestro initiated configuration update reboot
cnMaestro determines this code if device uptime mismatch on next re-
UNKNOWN connect, assuming device w ent for reboot due to pow er cycle/w atchdog
reset
UNGRACEFUL Ungraceful termination

24 Contacting Cambium Networks


Support Website http://www.cambiumnetworks.com/support
Main Website http://www.cambiumnetworks.com
Cambium Community http://community.cambiumnetworks.com
Sales Enquiries solutions@cambiumnetworks.com
Support Enquiries support@cambiumnetworks.com
Telephone Number List http://www.cambiumnetworks.com/support/contact-support
Cambium Networks Limited,
Address 3800 Golf Road, Suite 360,
Rolling Meadows, IL 60008 USA.

5/13/19 Page 71 of 71

Das könnte Ihnen auch gefallen