Skip to content

Driver journal entry

API path: /driver/journal/entry.

driver_journal_entry type is JSON object:

{
    "tracker_id": 1,  // Id of the tracker
    "start_date": "2018-08-28 07:03:39",  // Start date
    "end_date": "2018-08-28 08:05:02",  // End date
    "employee_id": 1,  // nullable. Driver
    "type": "work",  // Type ('work', 'personal', 'other')
    "comment": "comment string",  // nullable
    "start_location": {
        "lat": 11.0, // latitude
        "lng": 22.0, // longitude
        "address": "address value" // address
    },
    "end_location": {
        "lat": 11.0, // latitude
        "lng": 22.0, // longitude
        "address": "address value" // address
    },
    "length": 1.44,  // length
    "start_odometer": 1.34,  // nullable. Odometer's value at the start
    "end_odometer": 5.34,  // nullable. Odometer's value at the end
}

list

Get driver journal entries. There are two ways to get entries: by their ids or by specifying date range. If there no entry_ids in request, entries are selected by intersecting their date range with date range from request (from and to parameters).

parameters

  • tracker_idint. Id of the tracker
  • entry_idsint[]. (optional) Ids of the entries.
  • fromstring. (optional) Include tracks which end after this date, e.g. “2014-07-01 00:00:00”
  • tostring. (optional) Include tracks which start before this date, e.g. “2014-07-01 00:00:00”
  • typesstring[]. (optional) Types of the driver journal entry, e.g. [\"work\", \"personal\"]
  • sortstring[]. (optional) Set of sort options. Each option is a pair of column name and sorting direction, e.g. [“start_date=acs”, “type=desc”]. Possible columns:
    — start_date (sort only by date, not considering time part)
    — start_datetime (just raw column value)
    — end_date (sort only by date, not considering time part)
    — end_datetime (just raw column value)
    — start_address
    — end_address
    — driver (sort by last+first+middle driver name, not by driver id)
    — type
    If no sort param is specified, then sort option will be “start_date=acs”

response

{
    "success": true,
    "list": [ <driver_journal_entry>, ... ]
}

create

Create driver journal entries.

parameters

  • entriesdriver_journal_entry[]. Array of driver_journal_entry objects without id.

response

{ "success": true }

update

Update driver journal entry. Only two fields (type and comment) are available for update.

parameters

  • entrydriver_journal_entry_update_request type. See below.

response

{ "success": true }

driver_journal_entry_update_request type is JSON object:

{
    "id": 1, // id of the driver journal entry
    "type": 1, // new type of the driver journal entry
    "comment": "new comment" // new comment of the the driver journal entry
}

delete

Delete driver journal entries.

parameters

  • entry_idsint[]. Array of driver journal entries’ ids.

response

{ "success": true }

download

Get driver journal entries. Entries are selected by intersecting their date range with date range from request (from and to parameters).

parameters

same as in list method plus:

  • add_filename_headerboolean. Default value is true. If true then Content-Disposition header will be appended to the response.
  • formatstring. File format: ‘pdf’, ‘xls’ and ‘xlsx’
  • group_bystring. (optional) If specified, grouped entries will be in different sections of the table. Possible values: — type (group entries by entry type) — date (group entries by start_date per day)

response

A driver journal report file (standard file download).


Last update: August 21, 2020