NetCloud Manager API v2 Overview
Summary
Instructions
Obtaining API Keys
Making A Get Request
Server Timeouts when using NetCloud API
Related Articles
The NetCloud Manager (NCM) API is an interface for developers to integrate their systems and/or scripts with the data available in NetCloud Manager. This includes online/offline status of routers and network interfaces, signal strength and quality of cellular modems, router logs, and much more.
Developers often need to integrate the data collected by NCM into their internal network monitoring systems, log parsing applications, or network inventory management systems. The NCM API provides a robust interface for integrating these systems.
The NCM API is a RESTful HTTP interface that returns data in JSON format. This article instructs you how to enable your access the NCM API, manage your API keys, and access additional documentation and code examples in the API Portal.
To authenticate to the NCM API you must include the following pairs of keys in the headers of your HTTP request.
X-CP-API-ID
X-CP-API-KEY
X-ECM-API-ID
X-ECM-API-KEY
Use the following instructions to create and access these keys.
-
Log in to NetCloud Manager.
-
Click TOOLS in the left-side navigation panel, and then click the NetCloud API tab.
-
Use the following steps to add API keys to your account.
-
Click the Add button.
-
Select a role to associate with the keys 0n the Create NCM APIv2 Key page.
-
Add a label to display with the API keys in the Label field.
-
If you need to associate the API keys with a subaccount, click the Change link on the Account line and then select the subaccount.
-
Click the OK button to create the API keys. The New APIv2 Key dialog opens and displays your X-ECM-API-ID and X-ECM-API-KEY key values. You MUST copy these key values and save them in a secure location. You will be unable to access these keys after closing the New API Key dialog.
Click the OK button, after copying your API key values, to close the New API Key dialog.
-
Click the API Portal link to navigate to the Getting Started page on the API Portal. The Getting Started page lists your
X-CP-API-ID and X-CP-API-KEY API key values and contains other important links for using the portal.
A REST client or script can use API keys to make HTTP requests that get useful information from NetCloud Manager. This example uses Postman to demonstrate a request to the Net Device Metrics endpoint.
-
Open Postman, and then click the New button to create a request.
-
Make sure GET is selected, and then type in the following URL (callout 1).
url https://www.cradlepointecm.com/api/v2/net_device_metrics/
Note: This step and the following steps are displayed in the screenshot below.
-
Select the Headers tab underneath the URL, and then type in your keys (callout 2). The "KEY" value is the name of the key, and the "VALUE" will be the actual key text. Add all four of your keys.
-
Click the Send button. The results of your request display underneath where keys are typed in (callout 3).
For more information on available API endpoints and information about your account, visit the
API portal.
The NetCloud API is intended to serve queries that can be fulfilled in a reasonable, synchronous, web-request time frame. A “reasonable” amount of time in this context is up to ~10 seconds per query. When working with large data sets that might take longer than 10 seconds to retrieve, your queries may encounter a 408 timeout response that blocks you from receiving the expected response.
You can prevent server timeouts for your queries by limiting the scope of your queries.
For example, if a query for a 90-day date/time window is timing out, try 90 individual queries, each for a 1-day time window. If a query across 280,000 routers is timing out, try querying a smaller subset of those routers at a time. If a query potentially scans through millions of alerts records, try restricting the arguments so that the maximum dataset contains substantially less than a million alerts.