Default User Preferences contain a set of settings associated with a specific Account that are immediately available upon creation. These User Preferences often contain Account settings and controls the options that will or will not be available for the Users of that particular Account when accessing the portal and the application.
Fields
Tag |
Data Type |
Required |
Description |
accountId |
Long |
Auto |
The id of the Account that owns this record. |
displayName |
Text (unlimited) |
No |
The display name of the Default User Preference. |
id |
Auto-incremented Long |
Auto |
Unique Identifier |
isEditable |
Boolean |
No |
Indicates if the Default User Preference is editable or not. (Defaults to false) |
isParent |
Boolean |
Auto |
Indicates if the Default User Preference is a parent or not. |
key |
Character (255) |
No |
String identifier for the Default User Preference. Can either be one of the following:
- com.azugaeld.vtlib.GPS_SECONDS_INTERVAL
- com.azugaeld.vtlib.SHOW_DRIVER_LOGS
- com.azugaeld.vtlib.SHOW_JOBSITE
- com.azugaeld.vtlib.SHOW_WORKORDER
- com.azugaeld.vtlib.VBUS_DATA_SYNC_ENABLED
- com.azugaeld.vtlib.SERVER_CONTROLS_SETTINGS
- HOS_DRIVER_EDITING_ENABLED
|
lastChangedDate |
Text |
Auto |
Auto-generated timestamp of the last change made to this record Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z) |
prefType |
Character (255) |
No |
Indicates what type of value the key can be set to. Either: BOOL_PREF / STRING_PREF |
stringVal |
Text (unlimited) |
No |
Value of the Default User Preference |
API PATH: |
/api/v2/defaultUserPreferences |
METHOD: |
GET |
EXAMPLE RESPONSE: |
[
{
"key": "com.azugaeld.vtlib.SHOW_WORKORDER",
"prefType": "BOOL_PREF",
"stringVal": "true",
"isParent": true,
"displayName": "Show Work Orders",
"isEditable": true,
"accountId": 1247624,
"id": 49,
"lastChangedDate": "2015-04-30T23:03:08.711Z"
}
]
|
Update
API PATH: |
/api/v2/defaultUserPreferences |
METHOD: |
PUT |
EXAMPLE REQUEST: |
Note: After updating a parent Default User Preference, it will create a record with a different ID and the isParent field will be set to false. The new ID will be used to update the record in the future.
[
{
"key": "com.azugaeld.vtlib.SHOW_WORKORDER",
"prefType": "BOOL_PREF",
"stringVal": "false",
"displayName": "Show Work Orders",
"isEditable": true,
"id": 49
}
]
|
EXAMPLE RESPONSE: |
[
{
"key": "com.azugaeld.vtlib.SHOW_WORKORDER",
"prefType": "BOOL_PREF",
"stringVal": "false",
"isParent": false,
"displayName": "Show Work Orders",
"isEditable": true,
"accountId": 1248949,
"id": 774,
"lastChangedDate": "2016-12-29T03:40:18.723Z"
}
]
|
API error calls
ERROR MESSAGE |
POSSIBLE CAUSES |
POST is not supported. |
POST method is not allowed |
Id cannot be 0 for updates |
PUT error because request requires id |
Record with ID <id> does not exist. |
PUT error because user id does not exist |