Relating to sub-accounts. Sub-accounts provide access to an existing Track My Ride account with the ability to restrict access to vehicles and functionality/permissions.

Action-Get

Return the latest information on the subaccounts, currently active on the account

module=subaccounts&action=get

Returned data

An array of data containing the below information. If XML, data is contained inside <data>

NameDescriptionExample
unique_idThe TMR unique identifier for the subaccountcd308c97e91d8278
idSubaccount id2
usernameAccount usernametmr
permissionsTMR portal, page access and account permissions.

For further description, see the permissions table. in the User module.
{
5: 1,
...
}
The account can access the map page
nameConcatenated first and last name of sub-accountTrack My Ride Demo Account
emailEmail address for the sub-account[email protected]
phone_numContact number for the sub-account1300 553 022
addressEmployee address661 Waterdale Road, Heidelberg West, Vic 3081
account_numberParent account TMR number11397
vehicle_accessThe number of vehicles the account has access too
Values are:
"1 vehicle", "2 vehicles", ...
"4 vehicles"
vehicle_access_detailsA list of the vehicle names the sub-account can access"Delivery Van 1, TMR White, TMR Red, TMR Blue"
vehicle_access_uniqueA list of the vehicle unique ids the sub-account can access.

Comma-separated list
"56dfefe32345, fd34edadfef6, e0381501213c, 7198bf67b5fd"
api_keyAPI key for the sub-accountGF83FDSa72hds82jfFD82js123j3284mw8223
user_keyUser key for the sub-accountgtr873ns2eDSf111
linkA direct link to log into the TMR portal as the sub-account<https://app.trackmyride.com.au/v2/?user_key=gtr873ns2eDSf111&api_key=GF83FDSa72hds82jfFD82js123j3284mw8223>
statusThe active status of the account.

"Active": The sub-account is able to login into the TMR portal

"Disabled": The sub-account cannot access the TMR portal
Active

Action-Save

Update or create a sub-account

module=subaccounts&action=save

Required data

To update or create a sub-account, send the following variables in the request through query params or via form-data.

Variables are contained within variable "data". For example, to input the variable "unique_id" as "cd308c97e91d8278", add data[unique_id]=cd308c97e91d8278

❗️

Updating

When updating, all variables are required, otherwise, they will be set to default values.

NameDescriptionRequiredTypeExample
unique_idThe TMR unique identifier for the subaccountno, if not supplied, a new record will be created.Stringcd308c97e91d8278
usernameAccount email (username)YesString[email protected]
vehicle_access_uniqueAn array of vehicle unique_id's to grant access to.

* for all
YesArray["*"]
driver_access_uniqueAn array of vehicle unique_id's to grant access to.

* for all
YesArray["56dfefe32345"]
permissionsWhich permissions to grant the subaccount.

For a list of permission values see below
YesArray["page-map"]
account_activeWhether the user can log in to their TMR account.No, defaults to "false"String"true" or "false"
passwordAccount login passwordNo, if not submitted, a password will be randomly generatedStringt#hd%dsghs*h
emailEmail address for the sub-accountYesString[email protected]
nameEmployee full nameNoStringSally Grail
phone_numContact number for the sub-accountNoString1300 553 022
addressEmployee addressNoStringTrack My Ride
661 Waterdale Road
Heidelberg West, Victoria 3081
password_emailWhether to send an email containing account details to the new subaccountNo, defaults to "false"String"true" or "false"

Permissions array values

NameDescription
*Grants all permissions
page-mapView the map page
page-zonesView the zones page
page-vehiclesView the vehicles page
page-driversView the drivers page
page-alertsView the alerts page
page-reportsView the reports page
page-accountView the account page
add-recordsCreate new items
edit-recordsEdit items
delete-recordsDelete items
alert-recordsAccess all account alerts, including parent account

Example Request and Returned Data

For further info see here

Action-Delete

Delete an existing sub-account.

module=subaccounts&action=delete

Required data

To delete a sub-account, add the sub-account's unique ID into the data variable unique_id. For example, data[unique_id]=cd308c97e91d8278

Example Request and Returned Data

For further info see here