Device-based notifications

Action-Get

Return the latest 100 vehicle alerts across the account.

module=alerts&action=get

📘

To access alerts from a specific time period or per device, use the Alerts report

Example request

https://app.trackmyride.com.au/v2/php/api.php?api_key=GF83FDSa72hds82jfFD82js123j3284mw8223&user_key=gtr873ns2eDSf111&module=alerts&action=get

Returned Data

NameDescriptionExample
If XML: data contained inside <data>Array of objects{ created_at: "2021-09-23 17:24:13",
description: "Exited the zone Track My Ride Heidelberg West. Current speed is 33 km/h",
event_lat_lng: "
{"lat":"-37.731930","lng":"145.048432","address":"32-36 Mologa Road, Heidelberg West, VIC"}",
operator_name: "Sally Smith",
unique_id: "b9e2a95a2b1e7489",
vehicle_name: "TMR White"
}

Data included in returned data

For each row, the following data is included

NameDescription
unique_idThe unique ID of the alert
created_atTime the alert was raised in the device's local timezone.
created_at_epochEpoch time the alert was raised in the device's local timezone.
vehicle_nameThe device that triggered the alert
vehicle_unique_idThe TMR unique_id of the device that triggered the alert
event_lat_lngThe location the device was at. A string conversion of a JSON object like
{
lat: -37.731930,
lng: 145.048432,
address: "32-36 Mologa Road, Heidelberg West, VIC",
}
descriptionA text description of the alert
operator_nameThe driver of the vehicle
acknowledgedIf the alert is a panic/SOS event, this will return a JSON-encoded array of array containing the list of user's who have acknowledged the panic/SOS event.

[ [user_unique_id: the user's unique_id that acknowledged the alert,
utc_time: the time in YYYY-MM-DD HH:MM:SS format in UTC that the alert was acknowledged] ]

Action-Save

Create or update an alert.

module=alerts&action=save

Required data

To update or create an Alert, send variables as query params or via form-data. Data is contained in the variable "data". For example, to set the variable "frequency" to 15, add data[frequency]=15 .

❗️

Updating

When updating an alert, if a variable is not supplied in the update request it will remain set to its current value.

Description of Alert data properties

VariableTypeDescriptionRequiredExample
unique_idstringUnique id for the alert to be updated, if updating an existing record.

If you're creating a new record, don't pass this variable. One will be created for your new record and returned.
creating a new record : noupdating : yes7198bf67b5fd
frequencyintThe minimum frequency at which the alert can be triggered, in minutes.

Note: this applies on a per-vehicle per-zone basis
yes15
dayparts_ignorearrayAn array of hours in a day to ignore the alert

Days indexed from 0 to 6, with Sunday as 0

Hours indexed from 0 to 23, with 0 representing the entire hour of 12 am to 12:59:59 am
no

defaults to full coverage
[{"day": "0",
"hour": "10"}]
zones_limitarrayA set of zones in which the device must be in for the alert to trigger

Given as an array of zone unique id’s
no

defaults to none
["yhjdsakf83jn", "dsagfgjh3a"]
zones_ignorearrayA set of zones in which the alert will be suppressed and not raised if the event occurs within.

Given as an array of zone unique id’s
no

defaults to none
["yhjdsakf83jn", "dsagfgjh3a"]
vehicle_idarray or stringThe set of devices the alert is
being created for.

Can be supplied as an array for multiple vehicles, or a string for a single vehicle

Note:
"*" can be used as a wildcard to trigger this alert for all vehicles
yes["3dfaf3af3j1", "843hf92n"]
or
["*"]
emailstringThe email/s the alert may be sent to

Multiple emails are separated by a comma
no

defaults to none
"[email protected], [email protected]"
smsstringThe phone number/s the alert may be sent to in Australian 04xxxxxxxx format or international E.123 format

Multiple numbers are separated by a comma
no

defaults to none
"0444 444 444, 0433 333 333"
push_notificationsbooleanWhether to send push notification to a phone/s logged into the appyes1
or
0
alert_typestringThe type of the alert.

Details for this section are below
yesjourney
alert_criteriastringThe criteria used for the inputted alert type

Details for this section are below
yes

can be an empty string
journeyAfterParked30
statusBoolWhether the alert is active or notyes1
or
0
ac_notesStringAlert criteria notes. Specifically for maintenance alerts (Maint*) only. A note which will be included in the email when this alert is raised.noTire change and wheel alignment

Alert types and their event criteria

There are various alert types available, the criteria variable is used to extend the alert.

alert_typeMonitoringalert_criteria typealert_criteria rangeCriteria description
powerBelowVehicle's voltagefloat0-32.0The voltage threshold (Volts)
accOffToOnThe vehicle turned onempty--
autoGeofenceMovement while the vehicle is offempty--
motionSensorMotion sensor triggered while the engine is offempty--
inputsDevice input changesstring<input name>_<new state>

input1_high
input2_high
input1_low
input2_low
the input to monitor and the new stage

input1_high
creates an alert for when input1 switches to high
harsh_accelerationVehicle accelerating rapidlystring<vehicle_type>_<threshold in 0.01G’s>

Vehicle types are:
Passenger: 1
Van or truck: 2
Heavy vehicle: 3
Custom: 4

The threshold ranges from 0.25 to 3.0 G
The vehicle type and the minimal detected acceleration in 0.01G's

1_100
creates an alert for a passenger vehicle for an acceleration of 1 or more
G’s
harsh_brakingVehicle braking abruptlystring<vehicle_type>_<threshold in 0.01G’s>

Vehicle types are:
passenger: 1
Van or truck: 2
Heavy vehicle: 3
Custom: 4

The threshold ranges from 0.25 to 3.0 G
The vehicle type and the minimal detected acceleration in 0.01G's.

3_100 would create an alert for a Heavy vehicle for a braking event of 1 or more G’s.
harsh_corneringVehicle turning rapidlystring<vehicle_type>_<threshold in 0.01G’s>

Vehicle types are:
passenger: 1
Van or truck: 2
Heavy vehicle: 3
Custom: 4

The threshold ranges from 0.25 to 3.0 G
The vehicle type and the minimal detected acceleration in 0.01G's

1_100
creates an alert for a passenger vehicle for a turning event that creates a force of 1 or more G’s
journeyDevice tripsstringjourneyDuration3

journeyDuration2

journeyAfterParked30

journey6to6

journey23to6

journey00to11

journeyWeekend

journeySaturday

journeySunday

journeyWeekday

journeyAnytime
Moving for more than 3 hours

Moving for more than 2 hours

Moving after being stationary for more than 30 minutes
Moving between 6 pm and 6 am

Moving between 11 pm and 6 am

Moving between Midnight and 11 am

Moving on the weekend

Moving on Saturday

Moving on Sunday

Moving on a weekday

Vehicle detected moving
speedingThe device records a data point with a speed greater than the given oneStringspeeding<speed in km/h>

speeding108
A speed exceeding the given speed

A speed exceeding 108km/h
speeding_sustainedThe device records 3 data points with a speed greater than the given oneStringspeeding<speed in km/h>

speeding108
A sustained speed exceeding the given speed

A sustained speed exceeding 108km/h
zoneExitVehicle exiting a zoneString*

Comma separated uniqueIDs
23hcdj2ns, 4247ahsa
A zone exit alert will be created for all zones.

A zone exit alert will be created for the zones 23hcdj2ns, 4247ahsa.
zoneEnterVehicle entering a zoneString*

Comma separated uniqueIDs
23hcdj2ns, 4247ahsa
A zone enter alert will be created for all zones.

A zone enter alert will be created for zones 23hcdj2ns, 4247ahsa.
MaintOdometerOdometer based maintenanceint<odometer in km>
120 000
A maintenance alert will be triggered once the device's odometer exceeds 120 000km.

An “approaching maintenance alert” will also be triggered, when the odometer is within 1000km of the target.
MaintEngineHourmeterAlert based on engine run timeint<engine runtime in seconds>
360 000
An alert will be triggered as the engine hour-meter approaches and exceeds 360 000 seconds (100 hours).

An “approaching maintenance alert” will also be triggered, when the engine hour-meter is within 10 hours of the target.
MaintTravelDateA future date for maintenanceString<YYYY-MM-DD>
2022-06-30
An alert will be triggered once the date in the local timezone of the device exceeds 2022-06-30.

An “approaching maintenance alert” will also be triggered, when the date is within 7 days of the target.

Returned Data

See API Returned Data

Action-Delete

Delete an existing alert.

module=alerts&action=delete

Required data

To delete an Alert, add the alert's unique ID into the data variable unique_id. For example, data[unique_id]=23hhfHD92hsjKA

Example request

https://app.trackmyride.com.au/v2/php/api.php?api_key=GF83FDSa72hds82jfFD82js123j3284mw8223&user_key=gtr873ns2eDSf111&module=alerts&action=delete&data[unique_id]=DcSRjK2xWlCF

Returned Data

See API Returned Data

Action-Criterias

Return all configured alerts linked to the account.

module=alerts&action=criterias

Example request

https://app.trackmyride.com.au/v2/php/api.php?api_key=GF83FDSa72hds82jfFD82js123j3284mw8223&user_key=gtr873ns2eDSf111&module=alerts&action=criterias&json=1

Returned Data

NameDescriptionExample
If XML: data contained inside <data>Array of objects{
unique_id: 1544759850
vehicle_id: *
alert: zoneExit, 34874hjdfas
contact: "{email: [email protected], sms: 0432 123 123}" push_notifications:1
trigger_count: 21
creation_limit: 15
dayparts_ignore: "[{day: 0, hour: 10}]"
zones_ignore: 2hs8abd
zones_limit:
status:1
ac_notes: A note for the alert
}

Data included in returned data

For each row, the following data is included

NameDescription
unique_idThe alert's unique id
vehicle_idVehicle/s the alert is for. * is used for all vehicles
alertAlert type and criteria, concatenated
contactContacts are to be notified, as a string conversion of a JSON object
push_notificationsWhether the alert will trigger push notifications
trigger_countNumber of times the alert has been raised
creation_limitHow frequently the alert can be triggered, in minutes
dayparts_ignoreHours in a day to suppress the alert
[{ day:0, hour:10 }] -> the alert will not be raised from Sunday from 10:00 am to 10:59 am
zones_ignoreZones that the alert will not be raised in. Given as a comma-separated list of zone unique ids
zones_limitZones the vehicle must be in for the alert to be raised. Given as a comma-separated list of zone unique ids
statusWhether the alert is enabled or disabled (1 or 0)
ac_notesNotes to accompany the alert, specifically applicable for maintenance alerts only.