# How to use cnMaestro APIs

**URL:** <https://community.cambiumnetworks.com/t/how-to-use-cnmaestro-apis/98760>\
**Category:** cnWave 60 GHz\
**Tags:** knowledge-base\
**Created:** [April 11, 2024, 6:36am UTC](https://community.cambiumnetworks.com/t/how-to-use-cnmaestro-apis/98760 "2024-04-11T06:36:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Avva](https://d10gw3vjmzyp8.cloudfront.net/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@Kiran\_Avva](https://community.cambiumnetworks.com/u/Kiran_Avva)\
**Post date:** [April 11, 2024, 6:36am UTC](https://community.cambiumnetworks.com/t/how-to-use-cnmaestro-apis/98760/1 "2024-04-11T06:36:19Z")

</div>

# cnWave 60 GHz Network API Guide

This guide offers straightforward instructions for developers and network administrators on using the cnWave 60 GHz network’s API. It details the steps to obtain API credentials and execute the attached  
sample Python script to create sites, nodes and links.

[api\_sample\_usage.zip](https://community.cambiumnetworks.com/uploads/short-url/gX6Ti6hEAwQWD9mwf9v0xl35VrI.zip) (3.4 KB)

## GETTING STARTED

Before executing the script, ensure Python is installed on your system, and you’ve obtained the necessary API credentials: _client\_id_ and _client\_secret_.

**Prerequisites:**

- Python 3.x
- requests library
- Access to cnMaestro cloud with a Super Admin account in cnMaestro X

**Installing:**  
Ensure Python is installed by checking its version with either of the following  
commands, depending on your system:

```
python3 --version

```

Install the `requests` library using pip:

```
pip3 install requests

```

## Obtaining API Credentials:

1. Log in to cnMaestro cloud as a Super Admin, ensuring you’re on a cnMaestro X account.
2. Navigate to _Network Services → API Client_.
3. Click on “Add new API client,” fill in the details, and save. You’ll then see the “OAuth 2.0 Access Credentials” section.
4. Download the credentials as a JSON file or copy them directly from the screen.

## Configuring the Script:

After securing your credentials, prepare the `input_data.json` with your network’s specifics:

1. Open `input_data.json` in a text editor.
2. Replace `your_client_id` and `your_client_secret` with the actual credentials.
3. Replace ‘your\_network\_id’ with the E2E network id
4. Update placeholders in the “sites”, “nodes”, and “links” sections with your network configuration details. This encompasses `name`, `latitude`, `longitude`, `altitude`, and `accuracy` for sites; `name`, `pop`, `azimuth`, `elevation`, `mode`, `site`, `msn`, and `model` for nodes; and `name`, `a_node_name`, `a_node_mac`, `z_node_name`, `z_node_mac`, and `link_type` for links. To calculate `a_node_mac` and `z_node_mac` for sector 1, add 12 to the first octet of the node’s MAC address; for sector 2, add 22.
5. Confirm the `cn_maestro_url` and `network_id` align with your cnWave 60 GHz network setup.

## Running the Script:

Execute the script with the following command in your terminal or command prompt:

```
python3 site_node_link.py

```

## API DESCRIPTION

The script communicates with cnWave’s APIs for site, node, and link creation, with detailed documentation available through Cambium Networks’ Swagger instance. Briefly:

1. **Create Site API** : `/cnwave/60/networks/{network_id}/sites` - POST method to create a new site with details like name and location.

2. **Create Node API** : `/cnwave/60/devices` - POST method registers a new node device to the network. The request includes details about the node, such as its name, whether it is a pop, azimuth, elevation, mode (DN or CN), associated site, Serial number (cloud cnMaestro) or MAC address (on prem cnMaestro), and model.

3. **Create Link API** : `/cnwave/60/networks/{network_id}/links` - POST method for establishing a link between two nodes, requiring names and MAC addresses.

For comprehensive API details, including parameters and responses, visit: [Cambium Networks Swagger documentation](https://docs.cloud.cambiumnetworks.com/api/5.0.1/index.html#/60%20GHz%20cnWave)

Accessing the _Network Services → API Client_ in cnMaestro cloud and using the “Try It Out” button also directs you to an interactive documentation.

---

<div class="post-metadata">

**Author:** ![system](https://d1okf4ta8xniw3.cloudfront.net/original/3X/c/d/cd4301339a1ee0b92b361a580797b682408b951e.png) [@system](https://community.cambiumnetworks.com/u/system)\
**Post date:** [July 10, 2024, 6:36am UTC](https://community.cambiumnetworks.com/t/how-to-use-cnmaestro-apis/98760/2 "2024-07-10T06:36:23Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
