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.
See also:
Get Subscription Status
About Aggregated Billing Services
usageForAllAccounts
=false.usageForAllAccounts
setting does not matter.usageForAllAccounts
=true.
POST https://thingspace.verizon.com/api/loc/v1/usage
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 /api/m2m/v1/session/login. |
Content-Type required |
string | Must be application/json . |
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. |
{
"accountName": "1234567890-00001",
"startDate": "04-01-2018",
"endDate": "04-30-2018",
"usageForAllAccounts": true
}
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:
|
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. |
{
"accountName": "1223334444-00001",
"usageForAllAcounts": false,
"skuName": "TS-LOC-COARSE-CellID-Aggr",
"transactionsAllowed": "5000",
"totalTransactionCount": "350",
"PrimaryAccount": {
"accountName": "1223334444-00001",
"transactionsCount": "125"
},
"ManagedAccounts": []
}
{
"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"
}
]
}
{
"accountName": "3333355555-00001",
"usageForAllAcounts": false,
"skuName": "TS-LOC-COARSE-CellID-Aggr",
"transactionsAllowed": "5000",
"totalTransactionCount": "200",
"PrimaryAccount": {},
"ManagedAccounts": [
{
"accountName": "3333355555-00001",
"transactionsCount": "200"
}
]
}
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.