Standard APIsGlobal IoT OrchestrationAPI EndpointsRetrieve Aggregate Usage

API Reference

Retrieve Aggregate Usage

POST /devices/usage/actions/list/aggregate

This endpoint retrieves an aggregate, or summary, of usage for the device specified.

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 NameData TypeDescription
Authorization (required)stringHTTP Authorization bearer token: Authorization: Bearer {token}
VZ-M2M-Token (required)stringA valid session token: VZ-M2M-Token: {M2Mtoken}
Content-Type (required)stringMust be application/json Content-Type: application/json

HTTP Request

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

Request Parameters

Parameter NameData TypeDescription
deviceIds (required)arrayThe device ID value.
idstringThe numeric value of the device ID type.
kindstringThe type of device ID represented by the ID value. Only the following are supported by the request and both values must be present: eid - Electronic ID, a 32-digit unique ID of the device NOTE: for this query, only EID is valid.
accountName (required)stringThe numeric name of the account. This is in the format 0000123456-00001. Leading zeros must be included.
startTime (required)string ($datetime)The start of the time period requested.
endTime (required)string ($datetime)The end of the time period requested.

Request Body

Example request:

{
    "deviceIds": [
        {
            "id": "32-digit EID",
            "kind": "eid"
        }
    ],
    "accountName": "0000123456-00001",
    "startTime": "2023-10-01T00:00:00Z",
    "endTime": "2023-10-30T00:00:00Z"
}

Success Response

Status 200 A successful response shows a system generated request ID to track the request.

Example Response:

{
  "requestId": "d1f08526-5443-4054-9a29-4456490ea9f8"
}

Callback Response

These endpoints send responses asynchronously. In order to read the results a callback is required. To learn more about callbacks, please visit About Callback Services.

Example callback responses:

{
  "requestId": "d1f08526-5443-4054-9a29-4456490ea9f8",
  "deviceResponse": {
    "usageResponse": [
      {
        "deviceIds": [
          {
            "id": "32-digit EID",
            "kind": "eid"
          }
        ],
        "dataUsage": "245971989",
        "smsUsage": "6",
        "startDate": "2023-10-01T00:00:00.0000000+00:00",
        "endDate": "2023-10-30T00:00:00.0000000+00:00",
        "moSms": "5",
        "mtSms": "1"
      }
    ]
  },
  "callbackCount": 1,
  "maxCallbackThreshold": 4
}

Callback Parameters

ParameterData TypeDescription
requestIdstringThe requestId being viewed. This is a system generated value from the request above.
deviceResponseobjectContains the response from the device queried.
usageResponsearrayThe record of usage from the device queried.
deviceIdsarrayAn array of devices being queried by the request. Each deviceId will contain: id, kind
idstringThe numeric value of the device ID.
kindstringThe type of device ID represented by the ID value: eid - 32-digit Electronic ID
dataUsagestringThe total amount of data used (in Bytes) for that time period..
smsUsagestringThe total number of SMS (text) messages sent and received
startDatestring ($datetime)The starting point of the time period queried.
endDatestring ($datetime)The ending point of the time period queried.
moSmsstringMobile Originating SMS. Text messages sent.
mtSmsstringMobile Terminating SMS. Text messages received.
callbackCountstringThe number of responses for deviceResponse found.
maxCallbackThresholdstringThe maximum number of responses for deviceResponse allowed.

Failure Responses

All error responses will be in the following format.

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

On this page