Core API Reference
Core API Reference
The following v2 endpoints provide authentication, device status, BLE sensor data, historical snapshots, alarm points, smart lock operations, and geofence management.
Authentication
Request an access token with the getAccessToken action.
| Request field | Type | Required | Description |
|---|---|---|---|
getAccessToken.account |
String | Yes | Monitor account name. |
getAccessToken.password-md5 |
String | Yes | MD5 hash of the account password. |
getAccessToken.client-type |
String | Recommended | Client category, for example web or server. |
getAccessToken.client-id |
String | Recommended | Stable identifier for the calling client. |
getAccessToken.customer_name |
String | Optional | Account-specific customer name when provided by Topflytech. |
getAccessToken.sub-id |
String/Number | Optional | Sub-user identifier when the account uses sub-user login. |
| Response field | Type | Description |
|---|---|---|
code |
Number | 0 means success. Non-zero means the token was not issued. |
access-token |
String | Token used on authenticated v2 requests. |
id |
Number | Authenticated user id. |
user_lock |
Number | User lock state. |
keep-time |
Number | Token expiry timestamp in Unix epoch milliseconds. |
msg, i18nMsg, param |
String | Error message fields when authentication fails. |
Devices
List devices available to the authenticated account.
Read one device by API device identifier.
| Parameter | Type | Description |
|---|---|---|
access-token |
String | Required token. |
limit |
Number | Maximum number of devices to return. Use pagination for large fleets. |
offset |
Number | Pagination offset. |
{imei} |
String | API device identifier returned as devices[].imei by GET /v2/devices. Do not use device_key here unless an endpoint explicitly documents support for it. |
Device Object
| Field | Type | Description |
|---|---|---|
id |
Number | Device id returned by the service. Use imei as the stable API device identifier for integration. |
imei |
String | API device identifier. Use this value for Open API parameters named imei, and for device assignment fields such as devices or imeis. |
sn |
String/Number | Device serial number when available. |
model |
String | Device model. |
device_key |
String | Customer-visible device number shown in the Monitor platform when available. It may be the value users recognize as the device number, but it is not the default identifier for Open API imei parameters. |
permission |
Number | Permission level for the authenticated account. |
verified, valid |
Number | Device validation state when returned. |
config |
Object | Display and configuration fields for the device. |
status |
Object | Latest known telemetry/status fields. |
Device Configuration Fields
| Field | Type | Description |
|---|---|---|
name |
String | Device display name. |
type |
Number/String | Tracked object type when configured. |
description, comment |
String | Optional display notes. |
license, engine_number, vin |
String | Vehicle identifiers when configured. |
sim, customer_sim |
String | SIM identifiers when visible to the account. |
time_zone, daylight_saving_time |
Number | Device time-zone settings. |
added_date, expire_date, service_start_date, service_expire_date |
Number | Lifecycle timestamps in milliseconds when returned. |
max_speed, calibrated_mileage |
Number | Display or reporting settings when configured. |
Latest Status Fields
| Field | Type | Description |
|---|---|---|
online |
Number | Online state. 1 usually means online. |
date, location_date, last_reg_date |
Number | Status, location, or registration timestamps in milliseconds. |
lat, lng |
Number/String | Latest latitude and longitude for map display. |
latlng_valid |
Number | GPS validity flag. Treat non-1 locations as unreliable for map display. |
position_type |
String/Number | Position source/type when returned. |
altitude |
Number | Altitude in meters when available. |
speed |
Number | Speed value for the latest status point. |
azimuth |
Number | Direction in degrees. 0 is north, 90 is east. |
mileage |
Number | Reported mileage/distance value. |
acc |
Number | Ignition state when supported. |
ac |
Number | Air-conditioning state when supported. |
relay, relay_status |
Number | Relay or cut-off state when supported. |
lock_status, sub_lock_json_str |
Object/String | Main lock status and sub-lock status list when supported. See Smart Locks below. |
alerts, alerts1, alert_sum, event |
Number/String | Current or accumulated alarm/event code fields. |
external_power_voltage, battery_voltage, battery_voltage_percent |
Number | External power and battery values. |
network_signal, satellite_count |
Number | Network signal and GPS satellite count when available. |
address |
String | Resolved address when available. |
Optional Telemetry Groups
| Group | Representative fields | When to use |
|---|---|---|
| I/O | iop, input, output, analog1, analog2 |
Use only for devices with configured input/output or analog sensors. |
| Fuel | fuel, remain_fuel, remain_fuel_rate, rs232_fuel |
Use only when the account/device has fuel sensors enabled. |
| OBD | obd_speed, rpm, engine_load, obd_error_code, vin |
Use for OBD-capable devices. Values may be absent for normal GPS trackers. |
| BLE sensors | ble_tire_pressure_list, ble_temp_jsonarray_str, ble_door_jsonarray_str, ble_fuel_jsonarray_str |
Use for BLE accessory integrations. See BLE Sensors below for tire pressure and temperature/humidity usage. |
| Smart locks | lock_status, sub_lock_json_str |
Use for supported main lock or sub-lock integrations. Confirm closed state from status/realtime/alarm data. |
| Driver identification | driver_rfid, driver_ble_mac, driver_fingerprint_id |
Use when driver identification is configured. |
| Wi-Fi scan | wifi_date, self_mac, ap1_mac, ap1_rssi |
Use only for devices that report Wi-Fi positioning/scan data. |
Fields not listed above may still appear for backward compatibility or model-specific features. New integrations can ignore unknown fields and should check field existence before using optional telemetry groups.
Device Statuses
Read lightweight current status records for devices visible to the authenticated account. Use this endpoint for realtime push recovery, reconnect refresh, and controlled status polling.
| Parameter | Type | Description |
|---|---|---|
access-token |
String | Required token. |
| Response field | Type | Description |
|---|---|---|
code |
Number | 0 means success. |
device-statuses |
Array | Current status records for visible devices. |
device-statuses[].id |
Number | Device id. |
device-statuses[].imei |
String | API device identifier. Merge status updates into the client device map by this value. |
device-statuses[].status |
Object | Current telemetry/status object. It does not include device metadata or configuration. |
Status Fields
| Field | Type | Description |
|---|---|---|
online |
Number | Online state. 1 usually means online. |
date, heartbeat_time, location_date |
Number | Status, heartbeat, or location timestamps in Unix epoch milliseconds. |
lat, lng |
Number | Latest latitude and longitude for map display. |
latlng_valid |
Number | GPS validity flag. Treat non-1 locations as unreliable for map display. |
altitude, speed, mileage |
Number | Latest altitude, speed, and mileage values when available. |
acc, ac |
Number | Ignition and air-conditioning state when supported. |
alerts, event |
Number | Current alarm/event code fields. |
relay |
Number | Relay or cut-off state when supported. |
lock_status |
Object/String | Main lock state when supported. For sub-lock lists, use GET /v2/devices field status.sub_lock_json_str and realtime subLockInfo. |
upload_abnormal |
Number | Upload abnormal state when returned. |
iop, input, output, analog1, analog2 |
Number/String | I/O and analog values for supported models. |
fuel, rs232_fuel, remain_fuel, remain_fuel_rate |
Number | Fuel values when the device/account has fuel sensors enabled. |
ble_tire_pressure_list, ble_temp_jsonarray_str, ble_door_jsonarray_str, ble_fuel_jsonarray_str |
Array/String | BLE sensor values when returned by supported devices. ble_temp_jsonarray_str is a JSON string and should be parsed by the client when present. |
Use GET /v2/devices for the initial device list, device metadata, and configuration. Use GET /v2/device-statuses when only current status needs to be refreshed after realtime events or reconnects. Use GET /v2/snapshots for historical points.
Snapshots
Read historical location and status points for route playback or reports.
| Parameter | Type | Description |
|---|---|---|
access-token |
String | Required token. |
imei |
String | Required API device identifier returned as devices[].imei by GET /v2/devices. Do not use device_key for this parameter unless explicitly documented. |
from_date, to_date |
Number | Time range in Unix epoch milliseconds. |
offset |
Number | Pagination offset. |
limit |
Number | Maximum rows. The service caps very large requests; keep route pages reasonably sized. |
get_pre_snapshot |
Number | Optional. Use 1 when a route needs the previous point before from_date for line continuity. |
need_get_geo |
Number | Optional. Use 1 when geofence-related points are needed with route data. |
need_driver_id |
Number | Optional. Use 1 when driver id fields are needed and configured. |
alarm_codes |
String | Optional alarm filter. See Alarm Code Definitions below before using it. |
Snapshot Fields
| Field | Type | Description |
|---|---|---|
code |
Number | 0 means success. |
snapshots |
Array | Historical points sorted by time. |
snapshots[].id |
Number | Snapshot point id. |
snapshots[].imei |
String | API device identifier when returned. |
snapshots[].date |
Number | Point timestamp in milliseconds. |
snapshots[].latitude, snapshots[].longitude |
Number | Location coordinates. |
snapshots[].latlng_valid |
Number | GPS validity flag. |
snapshots[].speed |
Number | Speed at this point. |
snapshots[].azimuth |
Number | Direction in degrees. |
snapshots[].altitude |
Number | Altitude in meters when available. |
snapshots[].mileage |
Number | Mileage/distance value at this point. |
snapshots[].acc |
Number | Ignition state calculated from I/O status when available. |
snapshots[].alarm |
Number | Alarm/event code for the point. 0 means no alarm. |
snapshots[].address |
String | Resolved address when available. |
limit_msg |
String | Returned when the requested range/limit is too large or truncated. |
Complex Query Notes
- For route playback, request a bounded time range and paginate with
offsetandlimit. - Use
get_pre_snapshot=1when drawing a route line and the first visible segment needs the previous point. - Use
need_get_geo=1only when geofence events must be mixed into the route result. - Use
alarm_codesonly after confirming the packed alarm-code format in the Alarm Points section.
Alarm Points
Read alarm records grouped by device.
| Parameter | Type | Description |
|---|---|---|
access-token |
String | Required token. |
imei |
String | API device identifier filter returned as devices[].imei by GET /v2/devices. Recommended for production queries. |
from_date, to_date |
Number | Alarm time range in Unix epoch milliseconds. |
limit |
Number | Maximum alarm points to return. |
desc |
Number/String | Optional descending sort flag. |
alarm_codes |
String | Optional packed alarm-code filter. See the examples below. |
distinguish_geofence |
Number/String | Optional flag for separating geofence-related alarms when supported. |
| Response field | Type | Description |
|---|---|---|
code |
Number | 0 means success. |
alarm-points |
Array | Alarm groups by device. |
alarm-points[].imei |
String | API device identifier. |
alarm-points[].name |
String | Device display name. |
alarm-points[].points |
Array | Alarm point list for the device. |
points[].time |
Number | Alarm time in milliseconds. |
points[].pid |
Number | Snapshot/point id. |
points[].lat, points[].lng |
Number | Alarm location. |
points[].speed |
Number | Speed at the alarm point. |
points[].code |
Number | Alarm type code. Use this value to classify the alarm. |
points[].address |
String | Address when available. |
points[].desc |
String | Localized alarm description when available. |
points[].mileage |
Number | Mileage at the alarm point. |
Event / Alarm Code Definitions
The following values are used by fields such as alarm_code, alarm_codes, and realtime event payloads. Use the numeric code in API filters or comparisons; the hexadecimal value is provided as an equivalent reference for developers.
This table documents the public code value and its meaning. Other implementation details are not required for Open API integration.
| Code | Hex | Event / alarm name |
|---|---|---|
| 0 | 0x00000000 | None |
| 1 | 0x00000001 | Ignition |
| 2 | 0x00000002 | Parking |
| 4 | 0x00000004 | External Power Disconnected |
| 8 | 0x00000008 | Low Battery |
| 16 | 0x00000010 | SOS |
| 32 | 0x00000020 | Over Speed |
| 64 | 0x00000040 | Towed |
| 128 | 0x00000080 | Address Requested |
| 256 | 0x00000100 | Engine On |
| 512 | 0x00000200 | Fill Tank |
| 1024 | 0x00000400 | Fuel Leakage |
| 2048 | 0x00000800 | Leave Fence |
| 4096 | 0x00001000 | Into The Fence |
| 8192 | 0x00002000 | Air Conditioner On |
| 262144 | 0x00040000 | Air Conditioner Off |
| 524288 | 0x00080000 | Idle Start |
| 1048576 | 0x00100000 | Idle End |
| 2097152 | 0x00200000 | Vibration |
| 4194304 | 0x00400000 | Invalid Move |
| 8388608 | 0x00800000 | Poi |
| 16777216 | 0x01000000 | Poi |
| 16777217 | 0x01000001 | Tire Leak |
| 16777218 | 0x01000002 | TPS Low Battery |
| 16777220 | 0x01000004 | Tracker Low Power |
| 16777224 | 0x01000008 | Turn Over |
| 16777232 | 0x01000010 | Driver BLE Tag Low Voltage |
| 16777248 | 0x01000020 | Sosble Tag Low Voltage |
| 16777280 | 0x01000040 | Fall Down |
| 16777344 | 0x01000080 | Power On |
| 16777472 | 0x01000100 | Power Off |
| 16777728 | 0x01000200 | Abnormal Temperature |
| 16778240 | 0x01000400 | Task Fail |
| 16779264 | 0x01000800 | Unmount |
| 16781312 | 0x01001000 | Open Cover |
| 16785408 | 0x01002000 | Unboxing |
| 16793600 | 0x01004000 | Incline |
| 16809984 | 0x01008000 | Move |
| 16842752 | 0x01010000 | Incline Recover |
| 16908288 | 0x01020000 | Battery Power Lower Recover |
| 17039360 | 0x01040000 | Usb Connected |
| 17301504 | 0x01080000 | Inner Temperature High |
| 17825792 | 0x01100000 | Unmount Recover |
| 18874368 | 0x01200000 | Open Cover Recover |
| 20971520 | 0x01400000 | Unboxing Recover |
| 25165824 | 0x01800000 | Fall Down Recover |
| 33554432 | 0x02000000 | GSM Jammer Detection Start |
| 33554433 | 0x02000001 | Input 1 On |
| 33554434 | 0x02000002 | Input 1 Off |
| 33554436 | 0x02000004 | Input 2 On |
| 33554440 | 0x02000008 | Input 2 Off |
| 33554448 | 0x02000010 | Input 3 On |
| 33554464 | 0x02000020 | Input 3 Off |
| 33554496 | 0x02000040 | Input 4 On |
| 33554560 | 0x02000080 | Input 4 Off |
| 33554688 | 0x02000100 | Input 5 On |
| 33554944 | 0x02000200 | Input 5 Off |
| 33555456 | 0x02000400 | Input 6 On |
| 33556480 | 0x02000800 | Input 6 Off |
| 33558528 | 0x02001000 | Input 7 On |
| 33562624 | 0x02002000 | Input 7 Off |
| 33570816 | 0x02004000 | Input 8 On |
| 33587200 | 0x02008000 | Input 8 Off |
| 33619968 | 0x02010000 | Input 9 On |
| 33685504 | 0x02020000 | Input 9 Off |
| 33816576 | 0x02040000 | Input 10 On |
| 34078720 | 0x02080000 | Input 10 Off |
| 34603008 | 0x02100000 | Input 11 On |
| 35651584 | 0x02200000 | Input 11 Off |
| 37748736 | 0x02400000 | Input 12 On |
| 41943040 | 0x02800000 | Input 12 Off |
| 50331649 | 0x03000001 | Inner Temperature High Recover |
| 50331650 | 0x03000002 | Move Recover |
| 50331652 | 0x03000004 | Collision Recover |
| 50331656 | 0x03000008 | Usb Dis Connected |
| 50331664 | 0x03000010 | Lose GPS Signal |
| 50331680 | 0x03000020 | GPS Signal Recovery |
| 50331712 | 0x03000040 | Enter Sleep |
| 50331776 | 0x03000080 | Exit Sleep |
| 50331904 | 0x03000100 | GPS Antenna Cut |
| 50332160 | 0x03000200 | Inner Temperature Low |
| 50332672 | 0x03000400 | Armed |
| 50333696 | 0x03000800 | Disarmed |
| 50335744 | 0x03001000 | Ult Sensor Drop |
| 50339840 | 0x03002000 | Harsh Left Turn |
| 50348032 | 0x03004000 | Harsh Right Turn |
| 50364416 | 0x03008000 | Fast Decelerate |
| 50397184 | 0x03010000 | Fast Accelerate |
| 50462720 | 0x03020000 | Notice Maintenance |
| 50593792 | 0x03040000 | Enter Blind Area |
| 50855936 | 0x03080000 | Exit Blind Area |
| 51380224 | 0x03100000 | Inner Temperature Low Recover |
| 52428800 | 0x03200000 | RFID |
| 54525952 | 0x03400000 | BLE Door Status Change |
| 58720256 | 0x03800000 | BLE Temperature High |
| 67108864 | 0x04000000 | GSM Jammer Detection End |
| 67108865 | 0x04000001 | BLE Temperature Low |
| 67108866 | 0x04000002 | BLE Temperature Recover |
| 67108868 | 0x04000004 | BLE Humidity High |
| 67108872 | 0x04000008 | BLE Humidity Low |
| 67108880 | 0x04000010 | BLE Humidity Recover |
| 67108896 | 0x04000020 | Sharp Turn |
| 67108928 | 0x04000040 | Unlock |
| 67108992 | 0x04000080 | Lock |
| 67109120 | 0x04000100 | Thread Trimming |
| 67109376 | 0x04000200 | Activate The Network |
| 67109888 | 0x04000400 | Thread Trimming Recovery |
| 67110912 | 0x04000800 | Data Upload Timed Out |
| 67112960 | 0x04001000 | Speeding In Geofence |
| 67117056 | 0x04002000 | Short Time Stop |
| 67125248 | 0x04004000 | Over Speed Recover |
| 67141632 | 0x04008000 | Open Lock Error |
| 67174400 | 0x04010000 | Close Lock Error |
| 67239936 | 0x04020000 | Open Lock Error Recover |
| 67371008 | 0x04040000 | Close Lock Error Recover |
| 67633152 | 0x04080000 | Stop Vibration |
| 68157440 | 0x04100000 | Stop Towing |
| 69206016 | 0x04200000 | Third Party OBD Insertion |
| 71303168 | 0x04400000 | Third Party OBD Removal |
| 75497472 | 0x04800000 | Unauthorized Stop |
| 83886081 | 0x05000001 | Unauthorized Stop Recover |
| 83886082 | 0x05000002 | Extended GPS Signal Lost |
| 83886084 | 0x05000004 | Extended GPS Signal Recovery |
| 83886088 | 0x05000008 | Parking Timeout |
| 83886096 | 0x05000010 | Check In |
| 83886112 | 0x05000020 | Seat Belt Not Inserted |
| 83886144 | 0x05000040 | Light Status Change |
| 83886208 | 0x05000080 | Minor Driving Collision |
| 83886336 | 0x05000100 | Minor Parking Collision |
| 83886592 | 0x05000200 | Severe Driving Collision |
| 83887104 | 0x05000400 | Severe Parking Collision |
| 83888128 | 0x05000800 | High Illumination |
| 83890176 | 0x05001000 | High Illumination Recovery |
| 83894272 | 0x05002000 | Low Illumination |
| 83902464 | 0x05004000 | Low Illumination Recovery |
| 83918848 | 0x05008000 | Enter Power Saving Mode |
| 83951616 | 0x05010000 | Exit Power Saving Mode |
| 84017152 | 0x05020000 | High Ambient Temperature |
| 84148224 | 0x05040000 | High Ambient Temperature Recovery |
| 84410368 | 0x05080000 | Low Ambient Temperature |
| 84934656 | 0x05100000 | Low Ambient Temperature Recovery |
| 85983232 | 0x05200000 | High Ambient Humidity |
| 88080384 | 0x05400000 | High Ambient Humidity Recovery |
| 92274688 | 0x05800000 | Low Ambient Humidity |
| 100663297 | 0x06000001 | Low Ambient Humidity Recovery |
| 100663298 | 0x06000002 | Start Charging |
| 100663300 | 0x06000004 | Stop Charging |
| 100663304 | 0x06000008 | Lost Sub Lock Signal |
| 100663312 | 0x06000010 | Sub Lock Signal Recovery |
| 100663328 | 0x06000020 | Charging Overvoltage |
| 100663360 | 0x06000040 | Charge Overvoltage Recovery |
| 100663424 | 0x06000080 | Lock Box Open |
| 100663552 | 0x06000100 | Lock Box Closed |
| 100663808 | 0x06000200 | Ignition Abnormality |
| 100664320 | 0x06000400 | BLE Relay Lost |
| 100665344 | 0x06000800 | BLE Relay Lost Recovery |
| 100667392 | 0x06001000 | Enter Safe Zone |
| 100671488 | 0x06002000 | Leave Safe Zone |
| 100679680 | 0x06004000 | Start Barking |
| 100696064 | 0x06008000 | Stop Barking |
| 134217728 | 0x08000000 | External Power Recover |
| 268435456 | 0x10000000 | External Power Lower |
| 536870912 | 0x20000000 | Rude Driver |
| 1073741824 | 0x40000000 | Collision |
Using alarm_codes Filters
The alarm_codes query parameter accepts comma-separated numeric mask positions. For most integrations, it is simpler to query by device and time range, then classify returned points[].code values with the table above.
When server-side alarm filtering is required, build the mask from decimal code values:
| Scenario | How to build alarm_codes |
|---|---|
Codes below 16777216 |
Add the selected code values together. Example: SOS is 16 and Over Speed is 32, so use alarm_codes=48. |
Codes from 16777216 to 33554431 |
Use the second comma position and subtract 16777216 from the selected code. Example: code 16777220 uses alarm_codes=0,4. |
| Multiple code ranges | Keep each range in its own comma position. Unused earlier positions should be 0. |
Input Alarm Codes
Input alarms use the 0x02000000 group. Input n ON uses bit 2 * (n - 1); input n OFF uses bit 2 * (n - 1) + 1. Example: input 1 ON is 33554433, input 1 OFF is 33554434.
Alarm Policies
Alarm policies define which alarm event types are enabled for devices and how matching alarm notifications are handled. Use this API to create policy names, select alarm codes, assign devices, set active time windows, and control email/web/app delivery switches. Use /v2/alarm-points to query stored alarm records, and use Realtime Push to receive live alarm events.
List alarm policies visible to the authenticated account.
Create an alarm policy.
Update a policy name, enabled alarm codes, device assignment, active time window, default policy, or notification switches. Identify the existing policy with opr_sname.
Delete an alarm policy. Identify the policy with opr_sname.
What Alarm Policies Control
| Capability | How it is configured |
|---|---|
| Alarm type selection | Set codes to the grouped bitmask built from the Event / Alarm Code Definitions table. |
| Device assignment | Update devices with the IMEI list that should use this policy. |
| Default policy | Update is_default=true on one policy. The current default is returned as defaultName. |
| Active time window | Update jsondates and time_zone. If no time window is configured, treat the policy as always active. |
| Delivery switches | Use not_send_email, not_send_web, and not_send_app to disable specific notification channels for matching alarms. |
| Model-specific thresholds | Use towed and vibration only for devices that support these alarm settings. |
Request Fields
| Field | Used by | Description |
|---|---|---|
access-token |
All requests | Required access token. |
sname |
POST, PUT | Policy name. When renaming, send the new name in sname and the existing name in opr_sname. |
opr_sname |
PUT, DELETE | Existing policy name to update or delete. |
codes |
POST, PUT | Grouped alarm-code bitmask array. See Building codes below. |
devices |
PUT | Array of API device identifiers assigned to this policy. Use devices[].imei values returned by GET /v2/devices, and send the complete desired assignment list. |
is_default |
PUT | Use true to make this policy the account default. |
jsondates |
PUT | JSON string for weekly active time windows. The returned field is dates. |
time_zone |
PUT | Timezone offset used with jsondates, for example 8 for UTC+8. |
not_send_email, not_send_web, not_send_app |
PUT | 1 disables that delivery channel; 0 or omitted leaves it enabled according to account configuration. |
emails |
PUT | Email recipient string when email notification is configured for the policy. |
geo_ids |
POST, PUT | Optional geofence scope for geofence-related alarm use cases. |
towed |
POST, PUT | Towed alarm movement threshold in meters when supported. 0 disables this setting; common values are 50 to 500. |
vibration |
POST, PUT | Vibration setting level when supported. 0 disables this setting; supported levels are commonly 1 to 15. |
Response Fields
| Field | Type | Description |
|---|---|---|
code |
Number | 0 means success. |
alarm-policies.defaultName |
String | Name of the default policy, or an empty string when no default is set. |
alarm-policies.strategys |
Array | Policy list. Use this response field name exactly as returned. |
strategys[].sname |
String | Policy name. |
strategys[].codes |
Array | Grouped alarm-code bitmask values. |
strategys[].devices |
Array | Assigned API device identifiers when device assignment is available. |
strategys[].dates |
Array | Weekly active time windows returned from jsondates. |
strategys[].time_zone |
Number/String | Timezone offset used for dates. |
strategys[].towed, strategys[].vibration |
Number/String | Model-specific alarm settings when configured. |
strategys[].not_send_email, strategys[].not_send_web, strategys[].not_send_app |
Number | Delivery suppression flags. |
strategys[].emails, strategys[].geo_ids |
String | Optional policy configuration fields. |
Building codes
codes is a grouped bitmask array. Build it from the public event code value in the Event / Alarm Code Definitions table.
| Step | Rule |
|---|---|
| Group | group = Math.floor(eventCode / 0x01000000). The array index is the group number, so group 0 is codes[0]. |
| Bit value | bit = eventCode & 0x00ffffff. For group 0 alarms, this is the same as the event code. |
| Enable alarm | codes[group] = (codes[group] || 0) | bit. |
| Multiple groups | If a later group is used, keep earlier unused groups as 0 so the array positions remain stable. |
// Enable SOS (16), Over Speed (32), and Over Speed in Geofence
// (67112960 / 0x04001000). Initialize unused groups as 0.
var codes = [0, 0, 0, 0, 0];
codes[0] = codes[0] | 16 | 32; // 48
codes[4] = codes[4] | 0x001000; // 4096
// Send codes as: [48, 0, 0, 0, 4096]
The alarm_codes filter used by /v2/alarm-points follows the same grouped bitmask model, but it is passed as comma-separated values instead of a JSON array.
Examples
Create a policy that enables SOS and Over Speed:
POST /v2/alarm-policies?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"sname": "High Priority",
"codes": [48],
"towed": 200,
"vibration": 8
}
Assign devices to the policy:
PUT /v2/alarm-policies?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"opr_sname": "High Priority",
"devices": ["862000000000001", "862000000000002"]
}
Make the policy active only on weekdays from 08:00 to 18:00 in UTC+8:
PUT /v2/alarm-policies?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"opr_sname": "High Priority",
"jsondates": "[[],[[28800,64800]],[[28800,64800]],[[28800,64800]],[[28800,64800]],[[28800,64800]],[]]",
"time_zone": 8
}
The jsondates value is a 7-day array from Sunday to Saturday. Each day contains zero or more [startSecond,endSecond] ranges, counted from local midnight.
Disable web notification delivery for this policy while keeping other policy settings unchanged:
PUT /v2/alarm-policies?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"opr_sname": "High Priority",
"not_send_web": 1
}
Delete a policy:
DELETE /v2/alarm-policies?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"opr_sname": "High Priority"
}
Alarm code support, towed settings, vibration settings, and geofence-related behavior can vary by device model and account configuration. Check returned fields and ignore unsupported options gracefully.
Smart Locks
Smart lock support has two parts: remote unlock commands and the status/events that confirm whether a lock is open or closed. Open API v2 exposes unlock commands for supported main locks and sub-locks. Lock/close state is reported by device status, realtime push, and alarm records.
A close/lock event is device-reported state in this public v2 interface. There is no public v2 close action documented for smart locks; use the status and event fields below to confirm that the lock has closed.
Send a remote unlock command for supported smart lock devices. The request body contains exactly one action object.
Unlock Main Lock
| Field | Required | Description |
|---|---|---|
openLock.imei |
Yes | API device identifier returned as devices[].imei by GET /v2/devices. |
POST /v2/device-lock-cards/action?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"openLock": {
"imei": "API_DEVICE_IDENTIFIER"
}
}
Unlock Sub-lock
| Field | Required | Description |
|---|---|---|
openSubLock.imei |
Yes | API device identifier of the tracker that manages the sub-lock. |
openSubLock.ble_id |
Yes | Sub-lock BLE identifier. Read it from status.sub_lock_json_str or realtime subLockInfo.sub_lock_list[].ble_id. |
openSubLock.pwd |
Yes | 16-character password hash: MD5(password).substring(8, 24), lower-case hex. |
POST /v2/device-lock-cards/action?access-token=ACCESS_TOKEN
Content-Type: application/json
{
"openSubLock": {
"imei": "API_DEVICE_IDENTIFIER",
"ble_id": "SUB_LOCK_BLE_ID",
"pwd": "MD5_PASSWORD_SUBSTRING_8_24"
}
}
Command Response
| Field | Description |
|---|---|
code |
0 means the platform accepted and forwarded the command to the processing service. It does not by itself prove that the lock has physically opened. |
msg |
Optional processing-service message when returned. |
i18nMsg, param |
Error message key and related field when the request is rejected. |
The device must be online and the authenticated account must have permission to control the device. After sending an unlock command, wait for status/realtime/alarm updates before changing your own UI to a final open or closed state.
Main Lock Status
Main lock state is returned in status.lock_status on device/status responses and in realtime snapshot or onlyUpdateEvent messages when the field changes.
| Field | Type | Description |
|---|---|---|
lock_type |
Number | Lock result/status code. See Lock Status Codes below. |
lock_msg_date |
Number | Lock event timestamp in Unix epoch milliseconds. |
lock_id |
String | Lock identifier or card/source identifier when returned by the device. |
lat, lng |
Number | Location reported with the lock event when available. |
latlng_valid |
Number | GPS validity flag when returned. |
is_lock |
Boolean/Number | Current closed-state hint for request-completed status codes when returned. |
Sub-lock Status
Sub-lock state is returned by GET /v2/devices as status.sub_lock_json_str, a JSON string that clients should parse into an array. Realtime updates are delivered as subLockInfo; merge each item by ble_id.
| Field | Type | Description |
|---|---|---|
ble_id |
String | Sub-lock identifier used by openSubLock.ble_id. |
date |
Number | Sub-lock status timestamp in Unix epoch milliseconds. |
lock_type |
Number | Sub-lock result/status code. See Lock Status Codes below. |
latitude, longitude, latlng_valid |
Number | Sub-lock event location when available. |
speed, azimuth, altitude, satellite_number |
Number | Movement and GPS details when reported with the lock event. |
rssi |
Number | BLE signal strength in dBm. |
voltage, solar_voltage, temp |
Number | Battery, solar charging, and temperature values. |
is_charging, is_charging_over_voltage, is_low_power, is_high_temp, is_low_temp |
Boolean/Number | Sub-lock power and temperature state flags. |
is_open_lock_cover, is_open_back_cover |
Boolean/Number | Lock cover or back-cover open flags when supported. |
Lock Status Codes
| Hex code | Meaning | Integration handling |
|---|---|---|
0x00 |
Locked / closed | Treat the lock as closed. |
0x01 |
Thread trimming / tamper | Show a tamper state and check alarm records. |
0x02 |
Thread trimming recovery | Clear the tamper state if this is the latest status. |
0x03 |
Lock failed | Show a lock error state and wait for a newer status or alarm recovery. |
0x04, 0x09, 0x0A |
Unlock request completed by card, BLE, or button source | Use is_lock if returned to decide the current closed state. |
0x11, 0x21, 0x31, 0x41, 0x51 |
Unlock succeeded | Treat as unlocked/open unless a later closed status arrives. |
0x12, 0x22, 0x32, 0x42, 0x52 |
Unlock command timed out while waiting for lock-rope removal | Keep the state unresolved/closed and prompt the operator to inspect the lock. |
0x13, 0x23, 0x33, 0x43, 0x53 |
Unlock denied by geofence rule | Do not retry automatically; show the geofence restriction. |
0x14, 0x24, 0x34, 0x44, 0x54 |
Unlock failed | Show an unlock failure and wait for the next status or support action. |
0x15, 0x25, 0x35, 0x45, 0x55 |
Unlock succeeded, waiting for lock-rope removal | Show an intermediate unlocked/waiting state. |
0x16, 0x26, 0x36, 0x46, 0x56 |
Unlock failed because the lock is in thread-trimming/tamper state | Show tamper/error state and do not continue automatic unlock attempts. |
0x17, 0x27, 0x37, 0x47, 0x57 |
Source-specific locked / closed state | Treat the lock as closed. |
Related Alarm Names
Use GET /v2/alarm-points or notification push to build an audit trail of lock activity. The following public alarm names identify the lock meaning without exposing internal constants.
| Alarm name | Meaning |
|---|---|
Unlock |
Lock opened/unlocked event. |
Lock |
Lock closed/locked event. |
OpenLockError, OpenLockErrorRecover |
Unlock error and recovery. |
CloseLockError, CloseLockErrorRecover |
Lock/close error and recovery. |
LockBoxOpen, LockBoxClosed |
Lock box or cover open/closed event when supported. |
LostSubLockSignal, SubLockSignalRecovery |
Sub-lock signal lost and recovered. |
Recommended State Flow
- Load devices with
GET /v2/devicesand parsestatus.lock_statusandstatus.sub_lock_json_strwhen present. - For remote unlock, send
openLockoropenSubLockonly after the operator confirms the target device and lock. - Update the UI from realtime
snapshot,onlyUpdateEvent, andsubLockInfomessages. UseGET /v2/device-statusesorGET /v2/devicesafter reconnect. - Use
GET /v2/alarm-pointsto show lock/open/close history and error recovery in reports.
BLE Sensors
BLE accessories are reported as child sensor data under a parent tracker. Use the tracker API device identifier returned as devices[].imei as the parent key. The customer-visible device_key may look like an IMEI in Monitor, but it is not the default value for Open API parameters named imei.
Keep current readings and sensor configuration separate. Current readings come from GET /v2/devices, GET /v2/device-statuses, and realtime WebSocket messages. Sensor names, tire positions, BLE ids, and threshold settings come from the configuration endpoints below.
| Use case | Primary API | Merge key |
|---|---|---|
| Current BLE tire pressure | status.ble_tire_pressure_list from GET /v2/devices or GET /v2/device-statuses; realtime bleTire |
imei for the tracker, mac for the tire sensor. |
| BLE tire position/name configuration | GET /v2/tire-ble-mac |
imei plus mac or configured position. |
| Current BLE temperature/humidity | status.ble_temp_jsonarray_str from REST status; realtime bleTemp |
imei for the tracker, ble_id for the sensor. |
| BLE temperature/humidity sensor name and thresholds | GET /v2/device-ble-temps |
imei plus ble_id. |
BLE fields appear only when the device model, firmware, accessory, and account configuration support them. Treat missing fields, empty arrays, empty JSON strings, and values such as -999 as unavailable data.
BLE Tire Pressure
BLE tire pressure integrations usually need two datasets: the latest sensor readings and the tire sensor binding table. The reading list tells you what the sensor reported; the binding table tells you which tire slot/name that sensor belongs to.
List configured BLE tire pressure sensor bindings for devices visible to the authenticated account. Filter the returned rows by imei on the client when you only need one tracker.
Create, replace, or clear BLE tire sensor bindings for a tracker. This is a configuration write and may enqueue a command for the device; use it only when the account/device is allowed to configure BLE tire sensors.
| Binding field | Type | Description |
|---|---|---|
tire-ble-macs[].imei |
String | Parent tracker API device identifier. |
tire-ble-macs[].id |
Number | Binding row id. Keep it when updating an existing tire slot. |
tire-ble-macs[].mac |
String | BLE tire sensor MAC/id. Match this value with current readings in ble_tire_pressure_list[].mac. |
tire-ble-macs[].name |
String | Display name configured for that tire sensor. |
tire-ble-macs[].position |
Number | Tire slot index used by the platform UI. Keep the same index when rendering your own tire layout. |
tire-ble-macs[].device_type |
Number | 0 means BLE tire pressure. Ignore non-BLE tire rows if your page only supports BLE tire sensors. |
tire-ble-macs[].is_issued |
Number | Configuration issue state when returned. For normal display, use the latest binding row and current reading values. |
| PUT field | Required | Description |
|---|---|---|
imei |
Yes | Parent tracker API device identifier. |
device_type |
Yes | Use 0 for BLE tire pressure. |
id1 to id5 |
For existing slots | Existing binding ids for tire slot 1 to 5. Include the id when replacing or clearing an existing slot. |
mac1 to mac5 |
When setting a slot | Sensor MAC/id for tire slot 1 to 5. If an existing idN is sent with an empty macN, that binding is cleared. |
name1 to name5 |
Optional | Display name for tire slot 1 to 5. |
PUT https://openapi.tftiot.com/v2/tire-ble-mac?access-token=ACCESS_TOKEN
{
"imei": "API_DEVICE_IDENTIFIER",
"device_type": 0,
"id1": 123,
"mac1": "A1B2C3D4E5F6",
"name1": "Front Left",
"mac2": "A1B2C3D4E5F7",
"name2": "Front Right"
}
Current tire readings
Read current values from devices[].status.ble_tire_pressure_list or device-statuses[].status.ble_tire_pressure_list. Merge each reading with the binding list by imei and mac.
| Reading field | Type | Description |
|---|---|---|
mac |
String | BLE tire sensor MAC/id. Use it to match tire-ble-macs[].mac. |
date |
Number | Reading timestamp in Unix epoch milliseconds. |
airPressure |
Number | Tire pressure raw value in kPa. Display layers may convert it to bar or psi. |
airTemp |
Number | Tire air temperature raw value in Celsius. |
voltage |
Number | Sensor battery voltage in volts when reported. |
alarm |
Number | Current alarm bitmask/code for the sensor reading. Relevant public names include Tire Leak and TPS Low Battery. |
id, deviceType |
Number/String | Optional sensor/report identifiers when returned. Use mac as the normal merge key. |
isHadSendPowerAlert, isHadSendTireLeakAlert |
Number/Boolean | Optional alert delivery state flags. They are not required for normal display or API filtering. |
{
"code": 0,
"device-statuses": [
{
"imei": "API_DEVICE_IDENTIFIER",
"status": {
"ble_tire_pressure_list": [
{
"mac": "A1B2C3D4E5F6",
"date": 1700000000000,
"airPressure": 245,
"airTemp": 28,
"voltage": 2.92,
"alarm": 0
}
]
}
}
]
}
Recommended tire display flow
- Load tracker list with
GET /v2/devicesand usedevices[].imeias the parent key. - Load bindings with
GET /v2/tire-ble-mac, then keep only rows wheredevice_type=0. - Read current values from
status.ble_tire_pressure_listor realtimebleTire. - Merge by
mac, render the configured name/position, and show missing readings as offline or unavailable. - Use
GET /v2/alarm-pointsto show Tire Leak or TPS Low Battery history.
BLE Temperature / Humidity
BLE temperature/humidity integrations also separate current readings from configured sensor identity. In REST status responses, the current reading list is returned as a JSON string; parse it before using the values.
List configured BLE temperature/humidity sensors for one tracker. Omit imei to list sensors for all visible trackers.
Add one or more BLE temperature/humidity sensor ids to a tracker.
Rename a sensor, replace its BLE id, or update temperature/humidity alarm thresholds.
Remove one BLE temperature/humidity sensor binding.
POST, PUT, and DELETE are configuration writes and may enqueue device commands. Use them only from an authenticated management workflow after confirming the target imei and ble_id.
| Configuration field | Type | Description |
|---|---|---|
device-ble-temps[].imei |
String | Parent tracker API device identifier. |
device-ble-temps[].ble_id |
String | BLE temperature/humidity sensor id. Use this to match current readings. |
device-ble-temps[].name |
String | Display name configured for the sensor. |
high_temp, low_temp |
Number/String | Configured temperature alarm thresholds in Celsius when returned. |
high_humidity, low_humidity |
Number/String | Configured humidity alarm thresholds in percent when returned. |
| Write operation | Body fields | Description |
|---|---|---|
| POST | imei, ble_ids |
Add one or more sensor ids. ble_ids is an array of 8-character or 12-character BLE ids. |
| PUT | imei, old_ble_id, new_ble_id, optional name, high_temp, low_temp, high_humidity, low_humidity |
Rename, replace id, or set alarm thresholds for a configured sensor. |
| DELETE | imei, ble_id |
Remove one configured sensor id. |
POST https://openapi.tftiot.com/v2/device-ble-temps?access-token=ACCESS_TOKEN
{
"imei": "API_DEVICE_IDENTIFIER",
"ble_ids": ["A1B2C3D4"]
}
PUT https://openapi.tftiot.com/v2/device-ble-temps?access-token=ACCESS_TOKEN
{
"imei": "API_DEVICE_IDENTIFIER",
"old_ble_id": "A1B2C3D4",
"new_ble_id": "A1B2C3D4",
"name": "Cargo Box",
"high_temp": 8,
"low_temp": 2,
"high_humidity": 80,
"low_humidity": 20
}
Current temperature/humidity readings
REST status responses return status.ble_temp_jsonarray_str as a JSON string. If it is empty, missing, or invalid, treat the current sensor list as empty. Realtime bleTemp messages return the same kind of readings as an array named ble_temp_list.
| Reading field | Type | Description |
|---|---|---|
ble_id |
String | BLE sensor id. Match it with device-ble-temps[].ble_id. |
date |
Number | Reading timestamp in Unix epoch milliseconds. |
temp |
Number | Temperature raw value in Celsius. |
humidity |
Number | Relative humidity percentage. |
voltage |
Number | Sensor battery voltage when reported. |
battery_percent |
Number | Sensor battery percentage. |
light_intensity |
Number/Boolean | Light state when supported. 0 means dark, non-zero means bright. |
rssi |
Number | BLE signal strength in dBm. |
is_open_box |
Number/Boolean | Box/case open state when supported by the accessory. |
latitude, longitude |
Number | Location attached to the sensor reading when available. |
tempAlarmType, humidityAlarmType |
Number/String | Temperature or humidity alarm state/type when returned. Use alarm records for audit history. |
const list = status.ble_temp_jsonarray_str
? JSON.parse(status.ble_temp_jsonarray_str)
: [];
// Example parsed item
{
"ble_id": "A1B2C3D4",
"date": 1700000000000,
"temp": 4.8,
"humidity": 62,
"battery_percent": 91,
"light_intensity": 1,
"rssi": -63
}
Relevant alarm names
Use the Event / Alarm Code Definitions table above for numeric values. The BLE temperature/humidity names most commonly used by integrations are BLE Temperature High, BLE Temperature Low, BLE Temperature Recover, BLE Humidity High, BLE Humidity Low, and BLE Humidity Recover.
Recommended temperature/humidity display flow
- Load configured sensors with
GET /v2/device-ble-temps?imei=API_DEVICE_IDENTIFIER. - Read current values from
status.ble_temp_jsonarray_str, parse the JSON string, and merge readings byble_id. - Use realtime
bleTempto update the same sensor list without high-frequency polling. - After WebSocket reconnect or page reload, refresh with
GET /v2/device-statusesand parseble_temp_jsonarray_stragain. - Use
GET /v2/alarm-pointsfor temperature/humidity alarm history.
Geofences
List geofences visible to the authenticated account.
Create a geofence.
Update a geofence.
Delete a geofence.
| Parameter or field | Type | Description |
|---|---|---|
access-token |
String | Required token. |
ids |
Array/String | Optional geofence id filter for list requests. |
id |
Number | Geofence id. |
group_id |
Number | Geofence group id when returned. |
type |
Number | 0 exit, 1 enter, 2 enter and exit. |
lock_type |
Number | Lock-related geofence type when enabled for the account/device. |
no |
Number | Generated geofence number. |
name |
String | Geofence name. |
form_type |
Number | 0 polygon, 1 circle. |
polygon |
String | Geometry string. See the examples below. |
radius |
Number | Circle radius when form_type=1. |
description, description2 |
String | Description fields. |
imeis |
String/Array | Assigned API device identifiers when returned. Match these values to devices[].imei, not device_key. |
over_speed_enable, over_speed |
Number | Geofence overspeed settings when supported. |
Geometry Examples
Coordinates use latitude and longitude decimal degrees. A polygon requires at least three points, encoded as lat,lng,lat,lng,....
{
"name": "Warehouse Area",
"type": 2,
"form_type": 0,
"polygon": "22.5199,113.9190,22.5209,113.9190,22.5209,113.9200"
}
A circle uses the center point in polygon and the radius in meters.
{
"name": "Office Radius",
"type": 2,
"form_type": 1,
"polygon": "22.5199,113.9190",
"radius": 500
}
Overspeed In Geofence
When over_speed_enable=1 and over_speed is set, supported devices can report geofence overspeed code 67112960 while inside the geofence.
Some returned fields are account-specific or model-specific. Ignore unknown fields and check field existence before using optional geofence capabilities.