POST /devices/usage/actions/list
Returns the daily network data usage of a single device during a specified time period.
See also:
Retrieve Device Connection History
Retrieve Device Provisioning History
Each response includes a maximum of 500 records. To obtain more records, you can call the API multiple times, adjusting the earliest
value each time to start where the previous request finished.
You can retrieve device usage using a device identifier, or a label associated with the device in the request. If you want to use a label associated with a device in the request, you must first associate a label with a device, as described in Set Usage Segmentation Labels API.
The ThingSpace Platform calculates three types of usage data: data usage, SMS usage, and rated usage. For RTR customers, domestic usage and international usage may also be returned. These usage data types originate from the following sources:
There is no date range limit for the Device Usage Report. However, in accordance with ThingSpace Data Retention Policy, the records contained in this report are kept for 12 months. Though you may specify any date range, you will not receive results for records that are older than 12 months.
Requests for date ranges that span many months may time out due to the time required to retrieve records for every day in the reporting period. If a request times out, try sending two or more requests for shorter date ranges to get the equivalent data.
POST https://thingspace.verizon.com/api/m2m/v1/devices/usage/actions/list
None.
The request header must contain a current ThingSpace authorization bearer token and a valid VZ-M2M session token, and must set the content-type to JSON.
Parameter Name | Data Type | Description |
---|---|---|
Authorization required |
string | HTTP Authorization bearer token. |
VZ-M2M-Token required |
string | A valid session token returned by POST /session/login. |
Content-Type required |
string | Must be application/json . |
The request body identifies the device and reporting period that you want included in the report. You can specify a label, or deviceId in the request.
Parameter Name | Data Type | Description |
---|---|---|
label optional |
array of label identifiers. | Label name and value associated with the device. |
label.name
optional |
varchar(20) | The label name associated with the device. |
label.value
optional |
varchar(50) | The label value. |
deviceId required if not using label |
deviceId object | An identifier for a single device. |
kind,
id required for deviceId |
strings | The type and value of the device identifier.
|
earliest required |
string | The earliest date for which you want usage data. |
latest required |
string | The last date for which you want usage data. |
{
"deviceId": {
"id": "50684915885088839315521399821675",
"kind": "eid"
},
"earliest": "2018-03-20T00:00:01Z",
"latest": "2020-12-31T00:00:01Z"
}
{
"label": {
"value": "VINMwertty9",
"name": "VIN"
},
"earliest": "2018-03-20T00:00:01Z",
"latest": "2020-12-31T00:00:01Z"
}
Status 200 or 202
Returns a single device usage list response. For RTR customers, the response may include domestic usage and international usage as extended attributes.
Parameter Name | Data Type | Description |
---|---|---|
hasMoreData | boolean | False for a status 200 response. True for a status 202 response, indicating that there is more data to be retrieved. Send another request, adjusting the earliest value in the request based on the timestamp in the last record in the current response. |
deviceId | deviceId object | An identifier for a single device. |
kind,
id |
strings | The type and value of the device identifier.
|
usageHistory | response object | placeholder |
bytesUsed | int64 | The number of bytes that the device sent or received on the report date. |
extendedAttributes | array | The number of mobile-originated and mobile-terminated SMS messages on the report date. |
key | string | The key for an extended attribute. In this example, following key attributes are included:
|
value | string | The value for an extended attribute. |
smsUsed | int32 | The number of SMS messages that were sent or received on the report date. |
source | string | The source of the information for the reported usage. |
timestamp | dateTime | The date of the recorded usage. |
{
"hasMoreData": false,
"deviceId": {
"id": "50684915885088839315521399821675",
"kind": "eid"
},
"usageHistory": [
{
"bytesUsed": 4096,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
},
{
"key": "domesticUsage",
"value": "2048"
},
{
"key": "internationalUsage",
"value": "2048"
}
],
"smsUsed": 0,
"source": "Raw Usage",
"timestamp": "2020-12-01T00:00:00Z"
},
{
"bytesUsed": 8192,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
},
{
"key": "domesticUsage",
"value": "4096"
},
{
"key": "internationalUsage",
"value": "4096"
}
],
"smsUsed": 0,
"source": "Raw Usage",
"timestamp": "2020-12-02T00:00:00Z"
},
{
"bytesUsed": 4096,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
},
{
"key": "domesticUsage",
"value": "2048"
},
{
"key": "internationalUsage",
"value": "2048"
}
],
"smsUsed": 0,
"source": "Raw Usage",
"timestamp": "2020-12-09T00:00:00Z"
}
]
}
{
"hasMoreData": false,
"deviceId": {
"id": "50684915885088839315521399821675",
"kind": "Eid"
},
"usageHistory": [
{
"bytesUsed": 4096,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"smsUsed": 0,
"source": "Raw Usage",
"timestamp": "2020-12-01T00:00:00Z"
},
{
"bytesUsed": 8192,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"smsUsed": 0,
"source": "Raw Usage",
"timestamp": "2020-12-02T00:00:00Z"
},
{
"bytesUsed": 4096,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"smsUsed": 0,
"source": "Raw Usage",
"timestamp": "2020-12-09T00:00:00Z"
}
]
}
Status 400
All error messages are returned in this format:
{
"errorCode": "error code string",
"errorMessage": "error message string"
}
Error codes and messages are listed on the Error Messages page, along with explanations and suggestions for corrective actions.