Get location services usage information:

POST /usage

Returns the number of device location requests used by an account during a specified time period. Primary accounts can also see usage totals for their managed accounts.

Contents

See also:
Get Subscription Status
About Aggregated Billing Services

Uses and Requirements

  • To see only the usage by the primary account, use the primary account name and set usageForAllAccounts=false.
  • To see only the usage by a managed account, use the managed account’s name. The usageForAllAccounts setting does not matter.
  • To see usage by all accounts, including the total number of transactions, use the primary account name and set usageForAllAccounts=true.

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/loc/v1/usage

Resource Path and Query Parameters

None.

Header Parameters

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 /api/m2m/v1/session/login.
Content-Type
required
string Must be application/json.

Request Body

Parameter Name Data Type Description
accountName
required
string The name of the account for which you want usage information. An account name is usually in the format of 10 digits, a hyphen, and then five more digits. Must include any leading zeros.
startDate
required
date, as mm-dd-yyyy The first date to be included in the report.
endDate
required
date, as mm-dd-yyyy The last date to be included in the report.
usageForAllAccounts
optional
boolean Set to false to only see usage information for the specified account. If the account is a primary account, set this to true to see usage for all managed accounts.

Example Request Body

{
  "accountName": "1234567890-00001",
  "startDate": "04-01-2018",
  "endDate": "04-30-2018",
  "usageForAllAccounts": true
}

Success Responses

Status 200

A success response for a single account shows the susbscription type, the number of transactions allowed in a billing cycle, and the number of transactions used between the requested dates. The response for a primary account with usageForAllAccounts set to true also includes the number of transactions for each managed account.

Parameter Name Data Type Description
accountName string The billing account for which usage information was requested.
usageForAllAccounts boolean Indicates whether the request was for an aggregated usage report.
skuName string The Device Location subscription type, which will be one of these values:
TS-LOC-COARSE-CellID-5K
Monthly recurring subscription for 5,000 non-GPS device locate requests
TS-LOC-COARSE-CellID-10K
Monthly recurring subscription for 10,000 non-GPS device locate requests
TS-LOC-COARSE-CellID-100K
Monthly recurring subscription for 100,000 non-GPS device locate requests
TS-LOC-COARSE-CellID-1M
Monthly recurring subscription for 1,000,000 non-GPS device locate requests
TS-LOC-COARSE-CellID-Aggr or TS-LOC-COARSE-CellID-Aggr-ECPD
Aggregated billing account subscription
transactionsAllowed string The number of location requests included with the subscription type.
totalTransactionCount string The total number of billable device location requests during the reporting period from all included accounts
ManagedAccounts array Usage for managed accounts.
accountName
string The name of a managed account.
transactionAccount
string The number of billable device location requests used by this account.

Example Success Response for a Primary Account with usageForAllAccounts = false

{
  "accountName": "1223334444-00001",
  "usageForAllAcounts": false,
  "skuName": "TS-LOC-COARSE-CellID-Aggr",
  "transactionsAllowed": "5000",
  "totalTransactionCount": "350",
  "PrimaryAccount": {
    "accountName": "1223334444-00001",
    "transactionsCount": "125"
  },
  "ManagedAccounts": []
}

Example Success Response for a Primary Account with usageForAllAccounts = true

{
  "accountName": "1234567890-00001",
  "usageForAllAcounts": true,
  "skuName": "TS-LOC-COARSE-CellID-Aggr",
  "transactionsAllowed": "5000",
  "totalTransactionCount": "350",
  "PrimaryAccount": {
    "accountName": "1234567890-00001",
    "transactionsCount": "125"
  },
  "ManagedAccounts": [
    {
      "accountName": "1111122222-00001",
      "transactionsCount": "100"
    },
    {
      "accountName": "3333355555-00001",
      "transactionsCount": "200"
    },
    {
      "accountName": "6666677777-00001",
      "transactionsCount": "300"
    }
  ]
}

Example Success Response for a Managed Account

{
  "accountName": "3333355555-00001",
  "usageForAllAcounts": false,
  "skuName": "TS-LOC-COARSE-CellID-Aggr",
  "transactionsAllowed": "5000",
  "totalTransactionCount": "200",
  "PrimaryAccount": {},
  "ManagedAccounts": [
    {
      "accountName": "3333355555-00001",
      "transactionsCount": "200"
    }
  ]
}

Failure Responses

Status 400

All error messages are returned in this format:

{
  "errorCode": "The type of error, such as INVALID_REQUEST.",
  "errorMessage": "Additional error information."
}

Error codes and messages are listed on the Error Codes page, along with explanations and suggestions for corrective actions.