Usage API Reference
The Usage REST APIs allow system administrators to retrieve usage data for each of their Applications and Applications they manage. An API key is required to authenticate with this API. API keys are created and managed in the API Keys view.
The API Examples have "[api endpoint]" in the url example. You will need to substitute the correct API Endpoint for your region into the example to use it. See available API Endpoints here:
API Endpoints (click to view)
- [Europe: api-eun1.lns.netmoregroup.com]
- [North America: api-use1.lns.netmoregroup.com]
- [South America: api-sae1.lns.netmoregroup.com]
- [Asia Pacific: api-apse3.lns.netmoregroup.com]
Response types vary from method to method.
Note
The keys required for Usage API access and Onboarding API access are different, i.e. An Onboarding API key will not grant access to the Usage APIs and vice versa.
Details API
Returns the details of all usage data for a given Application, month, and year.
Resource URL
https://[api endpoint]/rest/integration/usage/details
HTTP Method
GET
Parameters
| Parameter | Description | Required | Default Value | Allowed Values |
|---|---|---|---|---|
| eui | The IEEE EUI-64 identifier for the LoRa Application. | Yes | Hexadecimal String | |
| month | The month to retrieve usage data for. | Yes | 1-12 | |
| year | The year to retrieve usage data for. | Yes | 1 | 1-XXXX |
Response
Content-Type: text/csv This web service returns a file containing all the devices on the Application and their usage statistics.
See Application Details File for descriptions of the field data in the CSV file.
| Code | Reason | Description |
|---|---|---|
| 200 | Success | Request was successfully processed |
| 403 | Authorization failure | Access to this resource has been rejected due to an authorization issue |
| 400 | Bad Request | Invalid request due to insufficient or malformed parameters |
| 404 | Application or File not found | Indicates that either the given Application cannot be found or there is no usage data for the given month/year |
Curl Example
curl -X GET \
'https://[api endpoint]/rest/integration/usage/details?eui=<EUI>&year=<YEAR>&month=<MONTH>' -H 'Authorization: <API_KEY_TO_USE>'
Contracts API
Returns the per contract usage data for a given Application, month, and year.
Resource URL
https://[api endpoint]/rest/integration/usage/contracts
HTTP Method
GET
Parameters
| Parameter | Description | Required | Default Value | Allowed Values |
|---|---|---|---|---|
| eui | The IEEE EUI-64 identifier for the LoRa Application. | Yes | Hexadecimal String | |
| month | The month to retrieve usage data for. | Yes | 1-12 | |
| year | The year to retrieve usage data for. | Yes | 1 | 1-XXXX |
Response
Content-Type: text/csv This WS returns a file containing all the contracts on the application and their usage statistics.
See Application Contracts File for descriptions of the field data in the CSV file.
| Code | Reason | Description |
|---|---|---|
| 200 | Success | Request was successfully processed |
| 403 | Authorization failure | Access to this resource has been rejected due to an authorization issue |
| 400 | Bad Request | Invalid request due to insufficient or malformed parameters |
| 404 | Application or File not found | Indicates that either the given Application cannot be found or there is no usage data for the given month/year |
Curl Example
curl -X GET \
'https://[api endpoint]/rest/integration/usage/contracts?eui=<EUI>&year=<YEAR>&month=<MONTH>' -H 'Authorization: <API_KEY_TO_USE>'