Retrieve Daily Usage

POST /devices/usage/actions/list

This endpoint will return the daily usage of a device in the time period specified.

Contents

Request Components

Header Parameters

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:
Authorization: Bearer {token}

VZ-M2M-Token
required
string

A valid session token:
VZ-M2M-Token: {M2Mtoken}

Content-Type
required
string

Must be application/json:
Content-Type: application/json

HTTP Request

POST https://thingspace.verizon.com/api/m2m/v1/devices/usage/actions/list

Request Parameters

Parameter Data Type Description

deviceId
required

object

A deviceId, which will contain:

  • id
  • kind
   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:

  • iccid - Integrated Circuit Card ID (SIM card)

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.

Request Body

Example request:

{
    "deviceId": {
        "id": "20-digit ICCID",
        "kind": "iccid"
    },
    "earliest": "2023-10-25T00:00:00Z",
    "latest": "2023-10-30T00:00:00Z"
}

Success Response

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"
        }
    ]
}

Response Parameters

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.

Failure Responses

All error responses will be in the following format

{
  "errorCode": "The 3-digit HTML error code",
  "errorMessage": "string"
}