The article includes:
This call provides the current reported total SMS and Data usage for the current billing period and includes a list of daily totals if usage is present.
Notes: MTD, "Month to date" refers to billing period to date, and not calendar month.
queryDeviceUsageBySIMNumber also returns the same information, but accepts a string input instead of a complex type, and maybe a better candidate for use with JSON or JavaScript.
URLs
Request URL (production) | https://prismproapi.koretelematics.com/4/TransactionalAPI.svc/json/queryDeviceUsage |
Request URL (sandbox) | https://prismproapi.sandbox.koretelematics.com/4/TransactionalAPI.svc/json/queryDeviceUsage |
Request method | Post |
Request
Field | Data type | Mandatory | Min length | Max length | Description |
request:simNumber | string | Y | 11 | 20 | The SIM number or ICCID. |
JSON request example
{
"request": {"SimNumber":"1234567891234567891"}
}
Response
Parameter name | Data type | Min length | Max length | Description |
requestStatus | int | Request status code (if unsuccessful). | ||
DataInBytesMtd | double | Data usage in bytes | ||
SimNumber | string | 11 | 50 | SIM or ICCID number. |
SmsMtd | int | Text messages to date for the month | ||
Usage:DataInBytes | bigint | Data usage in bytes. | ||
Usage:Sms | bigint | Number of text messages. | ||
Usage:UsageDate | datetime | Usage time and date. Use the Epoch Converter for the date stamp (remove -X000). |
JSON response example
{
"d": {
"__type": "QueryDeviceUsageResponse:https://PRiSMProAPI.koretelematics.com/types",
"DataInBytesMtd": 322981637,
"SimNumber": "12345678912345678912",
"SmsMtd": 10,
"Usage": [
{
"__type": "QueryDeviceUsageDetailRecord:https://PRiSMProAPI.koretelematics.com/types",
"DataInBytes": 94860722,
"Sms": 2,
"UsageDate": "/Date(1604030400000-0400)/"
},
{
"__type": "QueryDeviceUsageDetailRecord:https://PRiSMProAPI.koretelematics.com/types",
"DataInBytes": 602457,
"Sms": 6,
"UsageDate": "/Date(1604116800000-0400)/"
},
{
"__type": "QueryDeviceUsageDetailRecord:https://PRiSMProAPI.koretelematics.com/types",
"DataInBytes": 227518458,
"Sms": 2,
"UsageDate": "/Date(1604203200000-0400)/"
}
]
}
}