POST /devices/usage/actions/list
This endpoint will return the daily usage of a device in the time period specified.
The request header must set the content-type to JSON, contain a current ThingSpace authorization token and a current VZ-M2M session token. For more details on how to get these tokens, visit Getting Started.
Parameter Name | Data Type | Description |
---|---|---|
Authorization required |
string | HTTP Authorization bearer token: |
VZ-M2M-Token required |
string | A valid session token: |
Content-Type required |
string | Must be application/json: |
POST https://thingspace.verizon.com/api/m2m/v1/devices/usage/actions/list
Parameter | Data Type | Description |
---|---|---|
deviceId |
object | A deviceId, which will contain:
|
id |
string | The numeric value of the device ID type. |
kind |
string | The type of device ID represented by the ID value. Only the following are supported by the request and both values must be present:
NOTE: The only valid kind for this query is ICCID. |
earliest required |
string ($datetime) | The starting point of the time period requested. |
latest required |
string ($datetime) | The ending point of the time period requested. |
Example request:
{
"deviceId": {
"id": "20-digit ICCID",
"kind": "iccid"
},
"earliest": "2023-10-25T00:00:00Z",
"latest": "2023-10-30T00:00:00Z"
}
Status 200
Example Response:
{
"hasMoreData": false,
"deviceId": {
"id": "20-digit ICCID",
"kind": "iccid"
},
"usageHistory": [
{
"bytesUsed": 105369575,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 0,
"source": "Usage Feed",
"timestamp": "2023-10-25T00:00:00Z"
},
{
"bytesUsed": 64963283,
"extendedAttributes": [
{
"key": "MoSms",
"value": "2"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 2,
"source": "Usage Feed",
"timestamp": "2023-10-26T00:00:00Z"
},
{
"bytesUsed": 54895113,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 0,
"source": "Usage Feed",
"timestamp": "2023-10-26T00:00:00Z"
},
{
"bytesUsed": 816570,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 0,
"source": "Usage Feed",
"timestamp": "2023-10-27T00:00:00Z"
},
{
"bytesUsed": 792821,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 0,
"source": "Usage Feed",
"timestamp": "2023-10-28T00:00:00Z"
},
{
"bytesUsed": 778568,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 0,
"source": "Usage Feed",
"timestamp": "2023-10-29T00:00:00Z"
},
{
"bytesUsed": 789846,
"extendedAttributes": [
{
"key": "MoSms",
"value": "0"
},
{
"key": "MtSms",
"value": "0"
}
],
"servicePlan": "service plan name",
"smsUsed": 0,
"source": "Usage Feed",
"timestamp": "2023-10-30T00:00:00Z"
}
]
}
Parameter | Data Type | Description |
---|---|---|
hasMoreData | boolean | This flag will indicate if there is more than one page returned. |
deviceId |
object | The device ID being queried. |
id |
string | The numeric value of the device ID. |
kind |
string | The type of device ID represented by the ID value. The only value that will be returned is Integrated Circuit Card ID (ICCID). |
usageHistory | array | Contains usage for the device, segmented by day. |
bytesUsed | string | The total bytes of data used for that day |
extendedAttributes | array | Lists the number and type (sent or received) of SMS (text) messages. |
key | string | Shows if a text message was sent (Mobile Originated SMS or MoSms) or received (Mobile Terminated SMS or MtSms) |
value | string | The number of text messages |
servicePlan | string | The name of the service plan associated with the usage. |
smsUsed | string | The total number of SMS messages (sent and received) |
source | string | Where the usage data is coming from. |
timestamp | string ($datetime) | Timestamp of when the record was complete. |
All error responses will be in the following format
{
"errorCode": "The 3-digit HTML error code",
"errorMessage": "string"
}