Drivers list

This API retrieves a list of drivers along with their main and additional information, including availability and assigned tasks.

How to get data

Request address

To get the data, use the address: https://tasks.<server_address>/backend/public/get_drivers

Request method

GET

Request parameters

  • page — page number for selection (used for table visualization). Default: 1
  • start — offset for selection (used in SQL queries). Default: 0
  • limit — number of records to fetch. Default: 25
  • usr_id — user ID (from the authorization object)
  • acc_id — account ID (from the authorization object)
 

Example request

fetch("https://tasks.<server_address>/backend/public/get_drivers?_dc=1597911482130&page=1&start=0&limit=10000&sort=%5B%7B%22property%22%3A%22id%22%2C%22direction%22%3A
%22ASC%22%7D%5D", {
  method: "GET",
  headers: {
    "accept": "*/*",
    "accept-language": "uk-UA,uk;q=0.9,ru;q=0.8,en-US;q=0.7,en;q=0.6",
    "x-csrf-token": "CtrsOKz3NykfxWlyboPlq3LGNpPrWsCtIymrKq0G"
  },
  credentials: "include"
})
Response
{
  "page": 1,
  "items": [
    {
      "id": 403,
      "name": "base_1",
      "email": "base_1@mobile.task",
      "c_fio": "Sergey Bocharov",
      "c_driver_id": 1,
      "c_information": {
        "phone": "89895114069",
        "address": "",
        "description": "",
        "id": 1,
        "agent_id": 48162,
        "account_id": 1107,
        "name": "Sergey Bocharov",
        "vehicle_id": "10518",
        "vehicle_number": "ECO DRIVING",
        "passport": null
      },
      "is_busy": true,
      "c_tasks_id": "155433",
      "is_deleted": false
    }
  ],
  "total": 22,
  "msg": []
}
In response to the API request, the following is returned:
  • id — user ID
  • name — user login
  • email — user email
  • c_fio — full name of the user
  • c_driver_id — driver ID
  • c_information — additional information (phone, vehicle, passport, etc.)
  • is_busy — driver availability flag
  • c_tasks_id — list of assigned task IDs
  • is_deleted— flag indicating if the driver is deleted