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>
Name | Description | Example |
---|---|---|
unique_id | The TMR unique identifier for the subaccount | cd308c97e91d8278 |
id | Subaccount id | 2 |
username | Account username | tmr |
permissions | TMR 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 |
name | Concatenated first and last name of sub-account | Track My Ride Demo Account |
Email address for the sub-account | [email protected] | |
phone_num | Contact number for the sub-account | 1300 553 022 |
address | Employee address | 661 Waterdale Road, Heidelberg West, Vic 3081 |
account_number | Parent account TMR number | 11397 |
vehicle_access | The number of vehicles the account has access too Values are: "1 vehicle", "2 vehicles", ... | "4 vehicles" |
vehicle_access_details | A list of the vehicle names the sub-account can access | "Delivery Van 1, TMR White, TMR Red, TMR Blue" |
vehicle_access_unique | A list of the vehicle unique ids the sub-account can access. Comma-separated list | "56dfefe32345, fd34edadfef6, e0381501213c, 7198bf67b5fd" |
api_key | API key for the sub-account | GF83FDSa72hds82jfFD82js123j3284mw8223 |
user_key | User key for the sub-account | gtr873ns2eDSf111 |
link | A direct link to log into the TMR portal as the sub-account | <https://app.trackmyride.com.au/v2/?user_key=gtr873ns2eDSf111&api_key=GF83FDSa72hds82jfFD82js123j3284mw8223> |
status | The 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.
Name | Description | Required | Type | Example |
---|---|---|---|---|
unique_id | The TMR unique identifier for the subaccount | no, if not supplied, a new record will be created. | String | cd308c97e91d8278 |
username | Account email (username) | Yes | String | [email protected] |
vehicle_access_unique | An array of vehicle unique_id's to grant access to. * for all | Yes | Array | ["*"] |
driver_access_unique | An array of vehicle unique_id's to grant access to. * for all | Yes | Array | ["56dfefe32345"] |
permissions | Which permissions to grant the subaccount. For a list of permission values see below | Yes | Array | ["page-map"] |
account_active | Whether the user can log in to their TMR account. | No, defaults to "false" | String | "true" or "false" |
password | Account login password | No, if not submitted, a password will be randomly generated | String | t#hd%dsghs*h |
Email address for the sub-account | Yes | String | [email protected] | |
name | Employee full name | No | String | Sally Grail |
phone_num | Contact number for the sub-account | No | String | 1300 553 022 |
address | Employee address | No | String | Track My Ride 661 Waterdale Road Heidelberg West, Victoria 3081 |
password_email | Whether to send an email containing account details to the new subaccount | No, defaults to "false" | String | "true" or "false" |
Permissions array values
Name | Description |
---|---|
* | Grants all permissions |
page-map | View the map page |
page-zones | View the zones page |
page-vehicles | View the vehicles page |
page-drivers | View the drivers page |
page-alerts | View the alerts page |
page-reports | View the reports page |
page-account | View the account page |
add-records | Create new items |
edit-records | Edit items |
delete-records | Delete items |
alert-records | Access 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