Driver Daily Documents

The Driver Daily Documents are the supporting Documents attached by the User of the Hours of Service application. The Documents are used to check their Logs for accuracy.

Fields

Tag Data Type Required Description
accountId Long No The id of the Account that owns this record.
assetId * Long No The id of the Vehicle refueled based on the Fuel Receipt
changedBy Text Auto The id of the User who made the last change to this record
city * Character (255) No The city where the fuel was purchased based on the Fuel Receipt
cost * Double Precision No The price per liter of the fuel purchased based on the Fuel Receipt
dateTime * Text No The date and time when the fuel was purchased based on the Fuel Receipt
Note:
Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z)
documentType Character (255) Yes

Type of Document. This can either be:

  • Bill of Lading
  • Fuel Receipt
  • Accident Photo
  • Citation
  • Scale Ticket
  • PDF
  • Other
driverDailyId Long No The id of the Driver Daily record associated with Document. If this is not included in the POST, it automatically gets today’s Driver Daily id. If the Driver does not have a Driver Daily record for today yet, the API automatically creates one and uses that id.
fuelType * Character (255) No Type of the fuel purchased based on the Fuel Receipt. Can be any of the following:

  • Gasoline
  • SpecialDiesel
  • Gasohol
  • Propane
  • LNG
  • CNG
  • Ethanol
  • Methanol
  • E85
  • M85
  • A55
  • Biodiesel
liters * Double Precision No The number of liters purchased based on the Fuel Received
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)
media Array Yes, (No for Fuel Receipt) The uploaded media attached to the Document. This is not required for Fuel Receipt
note Text (unlimited) No Notes/Details about the Document.
odometerKm Double Precision No The Vehicle’s odometer value for the Fuel Receipt
referenceNumber Character (255) No The reference number of the Fuel Receipt
state Character (255) No The state where the fuel was purchased based on the Fuel Receipt
userId Long Yes The ID of the Driver of this Daily Document.

Read

API PATH: /api/v2/driverDailyDocuments/
METHOD: GET
PARAMETERS:

driver-daily-id – Retrieves matching records for a Driver Daily (e.g. driver-daily-id=247446, all Driver Dailies by default)
user-id – Retrieves matching records for a specific User (e.g. user-id=496650, all users by default)
asset-id – Retrieves matching records for a specific Vehicle. Also accepts comma-separated values for multiple Vehicles (e.g. asset-id=1356070, all Assets by default)
document-type – Retrieves matching records for a specific Document Type (e.g. document-type=Fuel Receipt, all Document Types by default)
fuel-type – Retrieves matching records for a specific Fuel Type (e.g. fuel-type=Gasoline, all fuel types by default)
from-date-time
and to-date-time – Retrieves matching records whose dateTime field is on or between the from-date-time and to-date-time parameters, respectively (e.g. from-date-time=2017-05-04T07:00:00.000Z&to-date-time=2017-05-06T07:00:00.000Z, all dateTime by default)
from-change-timestamp – Retrieves matching records that were changed after the specified timestamp (e.g. from-change-timestamp=2016-06-05T23:54:41.451Z, all timestamps by default)
to-change-timestamp – Retrieves matching records that were changed before the specified timestamp (e.g. to-change-timestamp=2016-06-05T23:54:41.451Z, REQUIRES from-change-timestamp)
offset – Retrieves matching records after an offset value (e.g. offset=2)
limit – Retrieves a number of records per page specified by the value (e.g. limit=10)
driverDailyDocumentId – Retrieves a driver daily document depending on the document’s ID

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=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 Driver Daily Document with the specified id: api/v2/driverDailyDocuments/149
Get all Driver Daily Documents for the specific User: ?user-id=1250941
Get two Driver Daily Documents of the current Account with an offset of 1 : ?offset=1&limit=2
Get all Driver Daily Documents of the current Account sorted by note alphabetically: ?sort=note
EXAMPLE RESPONSE:
[
  {
    "userId": 1258475,
    "driverDailyId": 379103,
    "documentType": "Fuel Receipt",
    "referenceNumber": "005",
    "note": "Sample Only",
    "media": [
      {
        "name": "IMG_2018-06-11-10.30.24.jpg",
        "filename": "IMG_2018-06-11-22.30.24.jpg",
        "id": 4189
      }
    ],
    "dateTime": "2018-06-11T11:00:00.000Z",
    "fuelType": "Gasoline",
    "city": "Las Vegas",
    "state": "NV",
    "odometerKm": 8,
    "cost": 8,
    "liters": 8,
    "assetId": 1356070,
    "accountId": 1248280,
    "id": 149,
    "changedBy": 1258475,
    "lastChangedDate": "2018-06-11T12:00:00.000Z"
  }
]

Create

API PATH: /api/v2/driverDailyDocuments/
METHOD: POST
EXAMPLE REQUEST: To create add a Driver Daily Document. The request must be a multipart. Header

Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468
User-Agent: Fiddler
Authorization: Basic [base64_Credentials]
Host: staging.vistracks.com

Body

-----------------------------acebdf13572468
Content-Disposition: form-data; name="json"

[
  {
    "userId": 1258475,
    "driverDailyId": 379103,
    "documentType": "Fuel Receipt",
    "referenceNumber": "005",
    "note": "Sample Only",
    "media": [
      {
        "name": "IMG_2018-06-11-22.30.24.jpg",
        "filename": "IMG_2018-06-11-22.30.24.jpg"
      }
    ],
    "dateTime": "2018-06-11T11:00:00.000Z",
    "fuelType": "Gasoline",
    "city": "Las Vegas",
    "state": "NV",
    "odometerKm": 8,
    "cost": 8,
    "liters": 8,
    "assetId": 1356070
  }
]

---------------------------acebdf13572468
Content-Disposition: form-data; name="file"; filename="IMG_2018-06-11-22.30.24.jpg"
Content-Type: image/png

<@INCLUDE *C:\Users\Marc\Desktop\IMG_2018-06-11-22.30.24.jpg*@>
---------------------------acebdf13572468--
EXAMPLE RESPONSE:
[
  {
    "userId": 1258475,
    "driverDailyId": 379103,
    "documentType": "Fuel Receipt",
    "referenceNumber": "005",
    "note": "Sample Only",
    "media": [
      {
        "name": "IMG_2018-06-11-22.30.24.jpg",
        "filename": "IMG_2018-06-11-22.30.24.jpg",
        "id": 4189
      }
    ],
    "dateTime": "2018-06-11T12:00:00.000Z",
    "fuelType": "Gasoline",
    "city": "Las Vegas",
    "state": "NV",
    "odometerKm": 8,
    "cost": 8,
    "liters": 8,
    "assetId": 1356070,
    "accountId": 1248280,
    "id": 149,
    "changedBy": 1258475,
    "lastChangedDate": "2018-06-11T12:00:00.000Z"
  }
]

Update

API PATH: /api/v2/driverDailyDocuments/
METHOD: PUT
EXAMPLE REQUEST:
[
  {
    "userId": 1258475,
    "driverDailyId": 379103,
    "documentType": "Fuel Receipt",
    "referenceNumber": "005",
    "note": "Sample Only",
    "media": [
      {
        "name": "IMG_2018-06-11-22.30.24.jpg",
        "filename": "IMG_2018-06-11-22.30.24.jpg",
        "id": 4189
      }
    ],
    "dateTime": "2018-06-11T11:00:00.000Z",
    "fuelType": "Gasoline",
    "city": "Las Vegas",
    "state": "NV",
    "odometerKm": 8,
    "cost": 8,
    "liters": 8,
    "assetId": 1356070,
    "accountId": 1248280,
    "id": 149
  }
]
EXAMPLE RESPONSE:
[
  {
    "userId": 1258475,
    "driverDailyId": 379103,
    "documentType": "Fuel Receipt",
    "referenceNumber": "005",
    "note": "Sample Only",
    "media": [
      {
        "name": "IMG_2018-06-11-22.30.24.jpg",
        "filename": "IMG_2018-06-11-22.30.24.jpg",
        "id": 4189
      }
    ],
    "dateTime": "2018-06-11T11:00:00.000Z",
    "fuelType": "Gasoline",
    "city": "Las Vegas",
    "state": "NV",
    "odometerKm": 8,
    "cost": 8,
    "liters": 8,
    "assetId": 1356070,
    "accountId": 1248280,
    "id": 149,
    "changedBy": 1258475,
    "lastChangedDate": "2018-06-11T12:00:00.000Z"
  }
]

Delete

API PATH: /api/v2/driverDailyDocuments/<id>
METHOD: DELETE

API error calls

ERROR MESSAGE POSSIBLE CAUSES
JSON read failed: <error> JSON error with the error message