How to Onboard devices to cnMaestro Cloud using API?

Summary:

cnMaestro supports a RESTful API as part of its Cloud 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.

Onboarding devices is different between Cloud and On-Premises. With On-Premises, you should use MAC in the API request or claim it through the cnMaestro UI and ensure the device is configured with the cnMaestro URL, it is placed in the onboarding queue by default, from which it can be approved into the account.

In contrast, with Cloud one needs to enter the Serial Number(MSN) of the device to claim it through the cnMaestro UI, or use API to claim the serial number or enter the Cambium ID and the onboarding key to claim it through the Device UI.

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

Supported Devices

Note : 60GHz cnWave is also part of the supported list.

Solution:

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.

Detailed information about generating access token are explained in the below link:

https://docs.cloud.cambiumnetworks.com/help/3.1.0/index.htm#UG_files/Restful%20API/RESTful%20API.htm?TocPath=Services%7CRESTful%20API%7C_____0

Here is the list of prerequisites that needs to be taken care before firing the API:

  • Request URL: Once you login to your cloud, you could get the cloud URL and use on your API client. Below is an example request URL.

requested url

  • HTTP Headers: Below parameters to be configured as per the request.
    o Authorization: “Bearer ”
    o Content-Type: application/json” and
    o Accept(Optional): application/json

header

  • Request Body:
    o Here you could mention all the parameters that you would like to send and below are the list of parameters which you could include in the response body.
    o For cnPilot devices, few parameters are good enough to onboard the device like

    {
          "msn": "<Device_MSN>",
          "name": "E410",
          "type": "wifi-enterprise",
          "approved": true
    }
    

Note:
Above information are mandatory to onboard the device to cloud account. However, if you need to onboard to On-Premises cnMaestro change it to “mac” instead of “msn”.

  For on-premises onboarding: 
     {
       "mac": "<Device_mac>",
       "name": "E410",
       "type": "wifi-enterprise",
       "approved": true
     }

Here is the list of other parameters that you could include in the response body:

body par1
body par2

Note :
Here is the list of device “type” for all other device models.

type

Here is an example for ePMP device onboarding via API:

  • Request URL:

request url example

  • Using CURL Request:

Curl command

  • Request Body:

ePMP msn

  • Server Response to Client API:

ePMP response

  • Check the status under Onboard > Devices

onboard screen shot

onbaorded and inventory

Note:

cnMaestro APIs are defined within the Swagger specification, accessed here
cnMaestro - RESTful API.
This section only presents additional details for the Device, Statistics and Performance APIs, which have unique responses based upon Device Type, and are difficult to present within Swagger. You could use this inbuild application to perform any API call for testing.

Restful API information(3.0.0 or Above firmware) for On-premises cnMaestro is available in the user guide, here is the link to download:

https://support.cambiumnetworks.com/files/cnmaestro/

  • On-Premises API Guide is available for <2.4.x firmware from below link:

https://support.cambiumnetworks.com/files/cnmaestro/archive

cnMaestro Cloud API guide link:

https://docs.cloud.cambiumnetworks.com/api/3.1.0/index.html#/

1 Like

Does the API require a paid cnMaestro subscription?

@nicksmpls, yes, the API is a cnMaestro X feature.