Relating to vehicle records and their associated GPS trackpoints.
Action-Get
Return the latest information and recorded trackpoint data for a single vehicle or all vehicles associated with the user’s account.
module=devices&action=get
Input Variables
The following variables can be added to the request via query parameters
Variable | Type | Description | Required? | Default value | Example |
---|---|---|---|---|---|
json | bool | Returned data formatted as JSON | No Will default to XML data format if not supplied. | 0 | 1 The data will be returned in JSON data format. |
limit | bool | To limit aaData and aaData_encoded array of data points to the 1 most recent data point. | No Recommended if you have a larger dataset of devices (> 100) on your account to improve the responsiveness of your request as the returned data set can be quite large. | 0 | 1 Limit the datapoints returned in aaData and aaData_encoded to the most recent 1 data point |
limit_aaData | bool | To limit aaData array of data points to the 1 most recent data point. Note: Does not limit aaData_encoded | No | 1 | 0 All data points for the period requested will be returned in aaData |
minutes | int | Return the GPS data points in aaData and aaData_encoded that have been recorded within the last x minutes from now. If no data points have been recorded within this time period, the most recent recorded point will be returned. Default : 1440 Minimum : 0 Maximum : 4320 | No Recommended if you have a larger dataset of devices (> 100) on your account to improve the responsiveness of your request as the returned data set can be quite large. | 1440 | 60 Limit the returned data set to the past 60 minutes of driving data. |
filter_vehicle | string | Filter the returned results so that only the vehicle/device that matches the supplied unique_id is returned. If this value is not supplied, all devices associated with the account will be returned. | No | 56dfefe32345 Only data for the vehicle/device with unique_id 56dfefe32345 will be returned. |
Example Request
https://app.trackmyride.com.au/v2/php/api.php?api_key=GF83FDSa72hds82jfFD82js123j3284mw8223&user_key=gtr873ns2eDSf111&module=devices&action=get&limit=1&filter_vehicle=7198bf67b5fd&json=1
Returned Data
Name | Description | Example |
---|---|---|
If XML: data contained inside <data> | An array of device data grouped by _<device ID> | [ _56dfefe32345: {...}, _7198bf67b5fd: {...} ] |
Data included in returned data
For each device, the following data is included in the returned data
Name | Description | Example |
---|---|---|
aaData | GPS location (lat, lng), speed (km/h), time (YYYY-MM-DD HH:MM:SS) and voltage (Volts) data. | [{ epoch: 1633390153, lat: -37.5695504111, lng: 144.725723918, speed: 0, time: "2021-10-05 10:29:13", volts: 12.313, }] |
aaData_encoded | An encoded array of aaData. The data is encoded to the Google polyline algorithm standard. Click to view more As part of the encoding, we have extended the algorithm to also store the time (YYYY-MM-DD HH:MM:SS) in epoch seconds and speed in km/h in addition to the default algorithm standard of lat and lng. Data is stored in the order of lat, lng, time, speed For a code sample of storing encoded polyline data with lat, lng and time elements. Click to view code | "txhdFwvirZqnsoj`B?" |
acc_counter | The engine on time. Decimal hour meter counting the total duration the vehicle has been turned on in Minutes in 1/10 increments. | "2167.0" -> approx. 36 hours |
activity | Deprecated - For internal use only. | - |
arrow_color | Deprecated - For internal use only. | - |
assignment | Deprecated - For internal use only. | - |
comms_delta | The number of seconds since the vehicle last communicated with the TMR servers. | 1777 |
cid | Track My Ride hardware unique communication ID, as marked on the tracker. | "E061" |
daylight_saving | Does this vehicle observe DST within Australia? String: "1" or "0" | "1" |
device_data | TMR internal use only | "0000000001" |
engine_runtime | Counter for the duration of all recorded journeys in decimal hours. | "1856.6" -> approx. 31 hours |
external_power | Is the hardware tracker connected to an external power source? If this is 0, it is running on its internal battery (Or was until it went flat) Boolean: 1 or 0 | 1 |
engine | For hardware trackers, is the engine on or off? Boolean: 1 or 0 | 1 |
gps_antenna gps_module gps_signal gsm_module gsm_signal | TMR internal use only | - |
internal_battery | For hardware trackers, the state of the internal battery. String: "Charging", "Charged", "Discharging" | - |
last_data_at | The time the tracker last communicated with the TMR servers. Shown in the tracker’s local time with DST applied if applicable. YYYY-MM-DD HH:MM:SS | "2021-10-05 10:26:20" |
last_data_at_epoch | Epoch representation of last_data_at | 1633353980 |
line_color | The colour in Hexadecimal that the vehicle's traveled path will be drawn in on the main map. | #FE2712 |
name | Vehicle's name | "Delivery Van 2" |
odometer | The odometer reading, in decimal km. Automatically updated as journeys are recorded and completed. | 153011.5 |
operator | Unique ID of the operator (driver) associated with this vehicle, if applicable. | "Qk7G6ZGzjteR" |
options | See info below | JSON object containing device option details |
rego | Vehicle registration number | "AD28BF" |
timezone | The timezone in hours of this vehicle/tracker. GMT+value Example 10 would be GMT+10 9.5 would be GMT+9.5 | 10 -> GMT+10 |
unique_id | The vehicle's TMR unique identifier | "56dfefe32345" |
updated_at | When the vehicle’s data was last updated or modified (UTC Timezone). YYYY-MM-DD HH:MM:SS | "2021-10-05 00:34:16" |
volts | A voltage reading of the TMR hardware unit's external power supply | 13.482 |
zone | The unique IDs of the zone(s) the vehicle is currently in, if applicable. If not in a zone, the value will be an empty string. A comma-separated list of zone unique IDs will be returned if the vehicle is in multiple zones. | "aA8qJyIwzhPR" |
zone_entry | UTC timestamp that the vehicle entered the current zone(s). YYYY-MM-DD HH:MM:SS | "2021-10-02 03:23:39" |
Action-Save
Update a vehicle’s associated records and values.
module=devices&action=save
Required data
To update a device, send the variables as query params or via form-data.
Data for the vehicle shall be supplied within the array variable "data". For example, to set the variable "odometer" to 20000, add data[odometer]=20000 to your request.
Updating
When updating a device, if a variable is not supplied in the update request it will remain set to its current value.
Variables
Name | Type | Description | Example |
---|---|---|---|
unique_id | string | The vehicle’s unique_id | 7198bf67b5fd |
name | string | Name of the vehicle | TMR Rodeo |
rego | string | Registration number of the vehicle | 576 KCH |
odometer | float | Odometer reading in km of the vehicle, with 1 decimal of precision | 185533.0 |
hourmeter | float | Journey hour meter in decimal hours, with 1 decimal of precision | 124.5 |
hourmeter_acc | float | Acc/Engine hour meter in decimal hours, with 1 decimal of precision | 127.4 |
timezone | float | The timezone in hours (GMT+ or -), with 1 decimal of precision | 9.5 |
dst | bool | Australian DST enabled = 1, disabled = 0. If set to 1, the vehicle's times will be automatically adjusted during Australian DST time periods. | 1 |
line_color | string | The colour in Hexadecimal that the vehicle's traveled path will be drawn in on the main map. | #0247FE |
input_action_1 | string | See below for info | 0 |
input_action_2 | string | See below for info | panic |
output_nickname_1 | string | See below for info | Security system |
output_nickname_2 | string | See below for info | Unused |
output_mode_1 | bool | See below for info | 0 |
output_mode_2 | bool | See below for info | 1 |
ignition_detection_mode | int | See below for info | 4 |
ignition_low_voltage_level | int | See below for info | 13200 |
icon | int | See below for info | 1 |
output_modify_1 | string | See below for info | true |
output_modify_2 | string | See below for info | false |
output_state_1 | string | See below for info | true |
output_state_2 | string | See below for info | false |
output_duration_1 | int | See below for info | 3600 |
output_duration_2 | int | See below for info | 60 |
Example Request and Returned Data
For further info see here
Device-Options
Track My Ride GPS devices have a number of options that are returned under the parameter options.
Name | Description | Options |
---|---|---|
input_action_1 | What internal function should occur when input #1 moves from low to high | 0 - No action panic - Trigger the panic/SOS button for this vehicle |
input_action_2 | What internal function should occur when input #2 moves from low to high | 0 - No action panic - Trigger the panic/SOS button for this vehicle |
output_nickname_1 | Nickname for output 1 | "Security system" |
output_nickname_2 | Nickname for output 2 | "" |
output_mode_1 | Whether output 1 is in manual or driver-login-reminder mode | 0 - Manual mode 1- driver-login-reminder Click to view more |
output_mode_2 | Whether output 2 is in manual or driver-login-reminder mode | 0 - Manual mode 1- driver-login-reminder Click to view more |
output_modify_1 | Whether you would like to modify the current values of output 1 | ''true"- to modify output "false" |
output_modify_2 | Whether you would like to modify the current values of output 2 | ''true"- to modify output "false" |
output_state_1 | The new state of output 1 | ''true"- Activate output (path to ground) "false"- Deactivate (No path to ground) |
output_state_2 | The new state of output 2 | ''true'- Activate output (path to ground) "false"- Deactivate (No path to ground) |
output_duration_1 | How long you would like output 1 to be changed for | Time in seconds to apply the modification 0 - 86400 (24 hours). 0 is permanently (Until device reboot, or firmware update) |
output_duration_2 | How long you would like output 1 to be changed for | Time in seconds to apply the modification 0 - 86400 (24 hours). 0 is permanently (Until device reboot, or firmware update) |
ignition_detection_mode | How the device determines when the engine is turned on | 1- ignition wire 2- motion sensor 4 - voltage 5 - voltage or ignition wire 6- voltage or motion sensor |
ignition_low_voltage_level | The ignition on voltage in millivolts. If using an ignition detection mode that uses voltage, a reading above this will cause the device to determine the engine as on. | 0 to 30000 (0V to 30V) |
icon | The vehicle's map icon is used to show this vehicle's location on the map. There are presently 59 different vehicle icons that can be used to represent the vehicle's type on the map. The map marker style (In application settings) must be set to "Round vehicle icons" for this to take effect. | 1- Car 2- Car (EV) ... 59- Cement Truck |
Action-Export
Export all device details including sub-account vehicle access as a CVS file
module=devices&action=export
Request returned data
Name | Description | Example |
---|---|---|
success | The result of the request | 1 |
filename | A link to download the csv file | https://app.trackmyride.com.au/v2/php/temp_output/vehicle_template.ee8004.csv |
notice | Information on the request |
CSV file
The downloadable csv file containes a list of all vehicles associated with the API and user keys. It contains the following information
Heading | Description | Example |
---|---|---|
imei | Track My Ride external hardware identifier, as marked on the tracker. | E061 |
name | The name of this vehicle/tracker. | Delivery Van 3 |
rego_num | Registration number of this vehicle/tracker. | TMR 007 |
odometer | The odometer reading in km | 123 321 |
time_zone | The timezone in minutes for this vehicle/tracker. | 600 -> GMT+10 |
daylight_saving | Whether this vehicle observes DST | 1 -> yes |
username_<sub-account-name> A heading for each sub-account. eg. username_manager | Whether the given sub-account has access to this vehicle. "TRUE" for yes or blank if not | TRUE |
Example file
Action-Import
Update a vehicle’s associated records and values via a CSV file
module=devices&action=import
CSV file format
Mutatable values are: name, rego_num, odometer, timezone, daylight_saving and username_<user> (sub-account permissions). For a description of these values, see the above table under Action-Export.
To update a vehicle's details, input the new details in the device row for the original imei. To grant vehicle access to a sub-account, use TRUE, to remove use FALSE.
CSV file in Excel
CSV raw
imei,name,rego_num,odometer,timezone,daylight_saving,username_joe,username_tmr
E061,New Name,NEW 007,200000,600,1,FALSE,FALSE
Returned data
For further info see here
Action-Set Driver
Update the assigned driver (operator) of a vehicle.
module=devices&action=set_driver
Required data
To set the driver for a vehicle, you will need to have the following properties contained in data through query params or via form-data.
Variables
Name | Description | Required | Example |
---|---|---|---|
unique_id | The unique ID for the vehicle | yes | 7198bf67b5fd |
driver_id | The unique id for the driver | yes | 8ab787d08ab787de |
Example Request and Returned Data
For further info see here
Action-Playback
Return historic tracking data for a vehicle over a period of time specified by the user.
module=devices&action=playback
This function uses the from_date and to_date, along with the same variables as the device get request. The returned data is also in the same format.
If no data is found during the given times, the latest data from the tracker will be returned.
Input data variables, in addition to those of action-get
Name | Description | Required | Example |
---|---|---|---|
from_date | The starting date-time to return data from. YYYY-MM-DD HH:MM:SS | yes | 2021-10-12 00:00:00 |
to_date | Data will be returned up to this date time YYYY-MM-DD HH:MM:SS | yes | 2021-10-12 23:59:59 |