The article includes:
This call retrieves totals for text (SMS) and data usage for a specific date range and includes a list of daily totals if usage is present.
Note: MTD (month to date) refers to the billing period, not the calendar month.
URLs
Request URL (production) | https://prismproapi.koretelematics.com/4/TransactionalAPI.svc/json/queryDeviceUsageBySimNumberAndDateRange |
Request URL (sandbox) | https://prismproapi.sandbox.koretelematics.com/4/TransactionalAPI.svc/json/queryDeviceUsageBySimNumberAndDateRange |
Request method | Post |
Request
Field | Data type | Mandatory | Min length | Max length | Description |
simNumber | string | Y | 11 | 20 | The SIM number or ICCID. |
startDate | Datetime | N | Start date in milliseconds (Use the Epoch Converter). | ||
endDate | Datetime | N | End date in milliseconds (Use the Epoch Converter). |
JSON request example
{
"simNumber": "12345678912345678912",
"startDate": "/Date(1604030400000-0400)/",
"endDate": "/Date(1604030400000-0400)/"
}
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)/"
}
]
}
}