List Drivers
curl --request GET \
--url https://{company}.datatruck.io/api/v1/openapi/drivers/list/ \
--header 'Authorization: <api-key>'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/drivers/list/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{company}.datatruck.io/api/v1/openapi/drivers/list/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{company}.datatruck.io/api/v1/openapi/drivers/list/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{company}.datatruck.io/api/v1/openapi/drivers/list/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{company}.datatruck.io/api/v1/openapi/drivers/list/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/drivers/list/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 123,
"next": "<string>",
"previous": "<string>",
"results": [
{
"id": 123,
"contact_number": "<string>",
"status": "<string>",
"employee_status": "<string>",
"driver_type": "<string>",
"account": {
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"username": "<string>",
"email": "<string>"
},
"gender": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"zip_code": "<string>",
"payment_tariff": {
"id": 123,
"tariff": "<string>",
"name": "<string>"
},
"hire_date": "2023-12-25",
"rehire_date": "2023-12-25",
"termination_note": "<string>",
"terminate_reason": "<string>",
"previous_terminate_note": "<string>",
"assigned_truck": {
"id": 123,
"unit_number": "<string>",
"plate_number": "<string>"
},
"assigned_trailer": {
"id": 123,
"unit_number": "<string>",
"plate_number": "<string>"
},
"team_driver": {
"id": 123,
"full_name": "<string>"
},
"assigned_dispatcher": {
"id": 123,
"full_name": "<string>"
},
"other_id": "<string>",
"safety_start_on": "2023-12-25",
"emergency_contact_name": "<string>",
"emergency_contact_number": "<string>",
"emergency_relationship": "<string>",
"emergency_contact_email": "<string>",
"emergency_contact_address1": "<string>",
"emergency_contact_address2": "<string>",
"emergency_contact_state": "<string>",
"emergency_contact_city": "<string>",
"emergency_contact_zip_code": "<string>"
}
]
}Endpoints
Driver List
Retrieves a paginated list of active drivers, including their truck, trailer, dispatcher, team driver, payment tariff, and emergency contact details.
GET
/
drivers
/
list
/
List Drivers
curl --request GET \
--url https://{company}.datatruck.io/api/v1/openapi/drivers/list/ \
--header 'Authorization: <api-key>'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/drivers/list/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{company}.datatruck.io/api/v1/openapi/drivers/list/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{company}.datatruck.io/api/v1/openapi/drivers/list/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{company}.datatruck.io/api/v1/openapi/drivers/list/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{company}.datatruck.io/api/v1/openapi/drivers/list/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/drivers/list/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 123,
"next": "<string>",
"previous": "<string>",
"results": [
{
"id": 123,
"contact_number": "<string>",
"status": "<string>",
"employee_status": "<string>",
"driver_type": "<string>",
"account": {
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"username": "<string>",
"email": "<string>"
},
"gender": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"zip_code": "<string>",
"payment_tariff": {
"id": 123,
"tariff": "<string>",
"name": "<string>"
},
"hire_date": "2023-12-25",
"rehire_date": "2023-12-25",
"termination_note": "<string>",
"terminate_reason": "<string>",
"previous_terminate_note": "<string>",
"assigned_truck": {
"id": 123,
"unit_number": "<string>",
"plate_number": "<string>"
},
"assigned_trailer": {
"id": 123,
"unit_number": "<string>",
"plate_number": "<string>"
},
"team_driver": {
"id": 123,
"full_name": "<string>"
},
"assigned_dispatcher": {
"id": 123,
"full_name": "<string>"
},
"other_id": "<string>",
"safety_start_on": "2023-12-25",
"emergency_contact_name": "<string>",
"emergency_contact_number": "<string>",
"emergency_relationship": "<string>",
"emergency_contact_email": "<string>",
"emergency_contact_address1": "<string>",
"emergency_contact_address2": "<string>",
"emergency_contact_state": "<string>",
"emergency_contact_city": "<string>",
"emergency_contact_zip_code": "<string>"
}
]
}Authorizations
Query Parameters
Page number for paginated results.
Example:
1
Number of results per page (max 25, default 10).
Required range:
x <= 25Example:
10
ORM field path to order by. Prefix with - for descending.
Example:
"account__last_name"
JSON-encoded array of filter objects. Each object has column, value, and contains (operator). Supported operators: is, is_not, is_in, is_not_in, contains, before, after, greater_than, less_than, between, between_datetime, isnull, today, exclude, exclude_in.
Example:
"[{\"column\":\"driver_type\",\"value\":\"Owner Operator\",\"contains\":\"is\"}]"
Response
200 - application/json
Successful response with a paginated list of drivers.
⌘I