List Trailers
curl --request GET \
--url https://{company}.datatruck.io/api/v1/openapi/trailers/list/ \
--header 'Authorization: <api-key>'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/trailers/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/trailers/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/trailers/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/trailers/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/trailers/list/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/trailers/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,
"unit_number": "<string>",
"vin": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"status": "<string>",
"plate_number": "<string>",
"state": "<string>",
"driver_operator": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>"
},
"co_driver_operator": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>"
},
"type": {
"id": 123,
"name": "<string>"
},
"dispatch_status": {
"id": 123,
"name": "<string>",
"color": "<string>"
}
}
]
}Endpoints
Trailer List
Retrieves a paginated list of active trailers, including their driver/co-driver operators, trailer type, dispatch status, unit number, VIN, make, model, and year.
GET
/
trailers
/
list
/
List Trailers
curl --request GET \
--url https://{company}.datatruck.io/api/v1/openapi/trailers/list/ \
--header 'Authorization: <api-key>'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/trailers/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/trailers/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/trailers/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/trailers/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/trailers/list/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/trailers/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,
"unit_number": "<string>",
"vin": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"status": "<string>",
"plate_number": "<string>",
"state": "<string>",
"driver_operator": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>"
},
"co_driver_operator": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>"
},
"type": {
"id": 123,
"name": "<string>"
},
"dispatch_status": {
"id": 123,
"name": "<string>",
"color": "<string>"
}
}
]
}Authorizations
Send your API key with the Token prefix: Authorization: Token <api-key>.
Query Parameters
Page number for paginated results.
Required range:
x >= 1Example:
1
Results per page. Default: 10. Use a positive integer, or all for every result on one page. No maximum.
Required range:
x >= 1Example:
10
Search term matched against unit_number, plate_number, vin, make, and model (case-insensitive).
Example:
"ABC123"
Filter trailers by exact status value.
Example:
"Active"
Response
200 - application/json
Successful response with a paginated list of trailers.