Assets refers to the collection of Vehicles and Trailers owned by an Account. An Asset is paired with a given ELD device capable of periodically reporting back its position and possibly other characteristics of the vehicle. Assets can be associated with Driver Histories, Asset Statuses, etc. containing information that the device and the HOS application has reported back to the Hours of Service servers.
Fields
Tag | Data Type | Required | Description |
accountId | Long | No | The id of the Account that owns this record. |
assetType | Character (255) | Yes | Indicates the type of this Asset. Can either be one of the following:
|
createDate | Text | Auto | Auto-generated timestamp of the date and time this record was created. Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z) |
deletedAt | Text | Auto | Indicates the date and time when the asset was soft-deleted. Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z). This is not returned for Assets that have not been soft-deleted. |
eldConnectionType * | Character (255) | No | The connection type of the device paired with this Asset. Allowed values:
|
eldConfigureWhenConnected * | Character (255) | No | Indicates whether the Asset is going to be configured when connected to the device. |
eldDevice * | Character (255) | No | The device type paired with this Asset. |
eldDeviceDescription * | Character (255) | No | The description of the device paired with this Asset. |
eldDeviceManufacturer * | Character (255) | No | The manufacturer of the device paired with this Asset. |
eldDeviceName * | Character (255) | No | The name of the device paired with this Asset. |
eldEsn | Long (10 digits) | No | The ELD ESN for the CalAmp device paired with this Asset. |
eldMacAddress * | Character (255) | No | The MAC address of the device paired with this Asset. |
eldPassword * | Character (255) | No | The password of the device paired with this Asset. |
eldPin * | Character (255) | No | The PIN of the device paired with this Asset. |
eldWifiApSsid * | Character (255) | No | The WiFi AP SSID of the device paired with this Asset. |
eldWifiApPassword * | Character (255) | No | The WiFI AP password of the device paired with this Asset. |
eldWifiSsid * | Character (255) | No | The WiFi SSID of the device paired with this Asset. |
externalId | Character (255) | No | Optional unique identifier for Asset. |
fields | Array | No | A collection of fields containing information of the device paired with this Asset. Note: This is a legacy property and will be removed on future releases. Use the properties prefixed with “eld” instead. |
firmwareVersion | Character (255) | No | The firmware version of the device paired to this Asset. |
formIds | Long | No | The id of the default DVIR Form associated with the Asset. |
gpsSource | Character (255) | No | Indicates the GPS source used by the Asset when reporting location. Can be any of the following values:
|
homeTerminalId | Long | No | The id of the Terminal under which this Asset belongs to. If not provided in the JSON POST or PUT, automatically assigns the authenticated Driver’s homeTerminalId or the Main Office Terminal if not available |
id | Auto-incremented Long | Auto | Unique identifier |
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) |
licensePlate | Text (unlimited) | No | The license plate of this Asset. |
licensePlateState | Text (unlimited) | No | The state of the license plate of this Asset. Can either be one of the following state codes:
|
name | Character (20) | Yes | The name of Asset as displayed in the user interface. |
odometerOffsetKm | Double Precision | No | Value of the odometer offset of this Asset in kilometers. |
regulationMode | Character (255) | No | Indicates the regulation mode used by this Asset. Can either be “ELD” or “AOBRD” |
vin | Character (255) | No | The VIN of this Asset. This must be valid VIN. |
visibilitySetIds | Array | No | Contains a list of IDs of the Visibility Sets that this Asset is included in. |
vbusConnectionRequired | boolean | true | If set to true, driver is required to connect to a VBUS device before he can go driving. |
Create
API PATH: | /api/v2/assets |
METHOD: | POST |
EXAMPLE REQUEST: |
[ { "assetType": "Vehicle", "eldConnectionType": "wifi_direct_pin_mode", "eldDevice": "DigiWVA", "eldDeviceName": "Dev01", "eldEsn": 1234567890, "eldMacAddress": "A4:3D:2A:FC:C7:59", "eldPassword": "MAZS92A004", "eldPin": "1234", "eldWifiApSsid": "SSID_1234", "eldWifiApPassword": "1234", "firmwareVersion": "", "formIds": [ 1227 ], "gpsSource": "EITHER_DEVICE", "homeTerminalId": 12708, "licensePlate": "VEH-X01", "licensePlateState": "IL", "name": "Truck01", "regulationMode": "ELD", "odometerOffsetKm": 0.0, "vbusConnectionRequired": false, "vin": "-5TDZA22C04S100724", "visibilitySetIds": [ 13017 ] } ] |
EXAMPLE RESPONSE: |
[ { "assetType": "Vehicle", "createDate": "2018-02-13T03:29:36.287Z", "eldConnectionType": "wifi_direct_pin_mode", "eldDevice": "DigiWVA", "eldDeviceName": "Dev01", "eldEsn": 1234567890, "eldMacAddress": "A4:3D:2A:FC:C7:59", "eldPassword": "MAZS92A004", "eldPin": "1234", "eldWifiApSsid": "SSID_1234", "eldWifiApPassword": "1234", "fields":[ { "name":"__eld_pin", "value":"1234" }, { "name":"__eld_password", "value":"MAZS92A004" }, { "name":"__eld_wifi_ap_password", "value":"1234" }, { "name":"__eld_connection_type", "value":"wifi_direct_pin_mode" }, { "name":"__eld_device", "value":"DigiWVA" }, { "name":"__eld_mac_address", "value":"98:87:76:65:54:A4" }, { "name":"__eld_device_name", "value":"Dev01" }, { "name":"__eld_wifi_ap_ssid", "value":"SSID_1234" } ], "firmwareVersion": "", "formIds": [ 1227 ], "gpsSource": "EITHER_DEVICE", "homeTerminalId": 12708, "licensePlate": "VEH-X01", "licensePlateState": "IL", "name": "Truck01", "regulationMode": "ELD", "odometerOffsetKm": 0.0, "vin": "-5TDZA22C04S100724", "visibilitySetIds": [ 13017 ], "accountId": 1259472, "vbusConnectionRequired": false "id": 1452357, "lastChangedDate": "2018-02-13T03:29:36.287Z" } ] |
Read
API PATH: | /api/v2/assets |
METHOD: | GET |
PARAMETERS: |
name – Retrieves the matching Asset with the specified name (e.g. name=Vehicle X, all names by default) |
SORTING: | sort=id – Sort records by their id field in ascending order (DEFAULT) sort=-id – Sort records by their id field in descending order sort=name – Sort records by their name field in ascending order sort=-name – Sort records by their name field in descending order sort=external-id – Sort records by their externalId field in ascending order sort=-external-id – Sort records by their externalId field in descending order sort=asset-type – Sort records by their assetType in ascending order sort=-asset-type – Sort records by their assetType field in descending order sort=last-changed-date– Sort records by their last change date field in ascending order sort=-last-changed-date– Sort records by their last change date field in descending order |
QUERY STRING EXAMPLES: | Get the asset with the specified id: api/v2/assets/1328279 Get all assets of the current account with the type of Trailer : ?asset-type=Trailer Get two assets of the current account with an offset of 1 : ?offset=1&limit=2 Get all assets of the current account sorted by names alphabetically: ?sort=name |
EXAMPLE RESPONSE: |
[ { "assetType": "Vehicle", "createDate": "2018-02-13T03:29:36.287Z", "eldConnectionType": "wifi_direct_pin_mode", "eldDevice": "DigiWVA", "eldDeviceName": "Dev01", "eldEsn": 1234567890, "eldMacAddress": "A4:3D:2A:FC:C7:59", "eldPassword": "MAZS92A004", "eldPin": "1234", "eldWifiApSsid": "SSID_1234", "eldWifiApPassword": "1234", "fields":[ { "name":"__eld_pin", "value":"1234" }, { "name":"__eld_password", "value":"MAZS92A004" }, { "name":"__eld_wifi_ap_password", "value":"1234" }, { "name":"__eld_connection_type", "value":"wifi_direct_pin_mode" }, { "name":"__eld_device", "value":"DigiWVA" }, { "name":"__eld_mac_address", "value":"98:87:76:65:54:A4" }, { "name":"__eld_device_name", "value":"Dev01" }, { "name":"__eld_wifi_ap_ssid", "value":"SSID_1234" } ], "firmwareVersion": "", "formIds": [ 1227 ], "gpsSource": "EITHER_DEVICE", "homeTerminalId": 12708, "licensePlate": "VEH-X01", "licensePlateState": "IL", "name": "Truck01", "regulationMode": "ELD", "odometerOffsetKm": 0.0, "vin": "-5TDZA22C04S100724", "visibilitySetIds": [ 13017 ], "accountId": 1259472, "vbusConnectionRequired":false "id": 1452357, "lastChangedDate": "2018-02-13T03:29:36.287Z" } ] |
Update
API PATH: | /api/v2/assets |
METHOD: | PUT |
EXAMPLE REQUEST: |
[ { "assetType": "Vehicle", "eldConnectionType": "wifi_direct_pin_mode", "eldDevice": "DigiWVA", "eldEsn": 1234567890, "eldDeviceName": "Dev01", "eldMacAddress": "A4:3D:2A:FC:C7:59", "eldPassword": "MAZS92A004", "eldPin": "1234", "eldWifiApSsid": "SSID_1234", "eldWifiApPassword": "1234", "firmwareVersion": "", "formIds": [ 1227 ], "gpsSource": "EITHER_DEVICE", "homeTerminalId": 12708, "licensePlate": "VEH-X01", "licensePlateState": "IL", "name": "Truck01", "regulationMode": "AOBRD", "odometerOffsetKm": 0.0, "vin": "-5TDZA22C04S100724", "vbusConnectionRequired": false, "visibilitySetIds": [ 13017 ], "id": 1452357 } ] |
EXAMPLE RESPONSE: |
[ { "assetType": "Vehicle", "createDate": "2018-02-13T03:29:36.287Z", "eldConnectionType": "wifi_direct_pin_mode", "eldDevice": "DigiWVA", "eldDeviceName": "Dev01", "eldEsn": 1234567890, "eldMacAddress": "A4:3D:2A:FC:C7:59", "eldPassword": "MAZS92A004", "eldPin": "1234", "eldWifiApSsid": "SSID_1234", "eldWifiApPassword": "1234", "fields":[ { "name":"__eld_pin", "value":"1234" }, { "name":"__eld_password", "value":"MAZS92A004" }, { "name":"__eld_wifi_ap_password", "value":"1234" }, { "name":"__eld_connection_type", "value":"wifi_direct_pin_mode" }, { "name":"__eld_device", "value":"DigiWVA" }, { "name":"__eld_mac_address", "value":"98:87:76:65:54:A4" }, { "name":"__eld_device_name", "value":"Dev01" }, { "name":"__eld_wifi_ap_ssid", "value":"SSID_1234" } ], "firmwareVersion": "", "formIds": [ 1227 ], "gpsSource": "EITHER_DEVICE", "homeTerminalId": 12708, "licensePlate": "VEH-X01", "licensePlateState": "IL", "name": "Truck01", "regulationMode": "AOBRD", "odometerOffsetKm": 0.0, "vin": "-5TDZA22C04S100724", "visibilitySetIds": [ 13017 ], "accountId": 1259472, "id": 1452357, "lastChangedDate": "2018-02-13T03:39:36.287Z" } ] |
Delete
API PATH: | /api/v2/assets/<id> |
METHOD: | DELETE |
DESCRIPTION: | Supports soft delete. Requires the PERM_EDIT_EQUIPMENT permission for users and drivers. Drivers must also be allowed to delete equipment, based on the “hos.driver.equipment.delete” account property and their “HOS_DELETE_EQUIPMENT” user preference, both must be set to true |
Delete for the Assets API is implemented using a soft-delete. This prevents SQL’s Cascade Delete from deleting any Driving records associated with a deleted Asset. Eventually, following the motor carrier’s data retention policy, the soft-delete will become a hard-delete.
Vehicle’s eldConnectionProperties
The properties prefixed with “eld” (previously the “fields” property) are the eldConnectionProperties of an Asset. These fields contain the configuration details needed for setting up the devices that the Hours of Service system supports. The details on how to use the fields with regards to the devices are explained fully in the Installation Guides.
API error calls
ERROR MESSAGE | POSSIBLE CAUSES |
Access Denied. | POST, PUT and DELETE methods require a user role of ASSETADMIN or higher |
An asset with the given id was not found | PUT error because asset id does not exist |
Cannot modify a deleted entity. | PUT error because a soft-deleted record cannot be updated. |
Entity is already deleted. | DELETE error because a soft-deleted record cannot be deleted again. |