curl --request POST \
--url https://{company}.datatruck.io/api/v1/openapi/trailers/create/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"make": "<string>",
"model": "<string>",
"year": 123,
"unit_number": "<string>",
"vin": "<string>",
"plate_number": "<string>",
"state": "<string>",
"status": "<string>",
"ownership": "<string>",
"company_mc": 123,
"notes": "<string>",
"driver_operator": 123,
"co_driver_operator": 123,
"reg_expiry_date": "2023-12-25",
"last_annual_inspection_date": "2023-12-25",
"owner": 123
}
'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/trailers/create/"
payload = {
"make": "<string>",
"model": "<string>",
"year": 123,
"unit_number": "<string>",
"vin": "<string>",
"plate_number": "<string>",
"state": "<string>",
"status": "<string>",
"ownership": "<string>",
"company_mc": 123,
"notes": "<string>",
"driver_operator": 123,
"co_driver_operator": 123,
"reg_expiry_date": "2023-12-25",
"last_annual_inspection_date": "2023-12-25",
"owner": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
make: '<string>',
model: '<string>',
year: 123,
unit_number: '<string>',
vin: '<string>',
plate_number: '<string>',
state: '<string>',
status: '<string>',
ownership: '<string>',
company_mc: 123,
notes: '<string>',
driver_operator: 123,
co_driver_operator: 123,
reg_expiry_date: '2023-12-25',
last_annual_inspection_date: '2023-12-25',
owner: 123
})
};
fetch('https://{company}.datatruck.io/api/v1/openapi/trailers/create/', 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/create/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'make' => '<string>',
'model' => '<string>',
'year' => 123,
'unit_number' => '<string>',
'vin' => '<string>',
'plate_number' => '<string>',
'state' => '<string>',
'status' => '<string>',
'ownership' => '<string>',
'company_mc' => 123,
'notes' => '<string>',
'driver_operator' => 123,
'co_driver_operator' => 123,
'reg_expiry_date' => '2023-12-25',
'last_annual_inspection_date' => '2023-12-25',
'owner' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{company}.datatruck.io/api/v1/openapi/trailers/create/"
payload := strings.NewReader("{\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"unit_number\": \"<string>\",\n \"vin\": \"<string>\",\n \"plate_number\": \"<string>\",\n \"state\": \"<string>\",\n \"status\": \"<string>\",\n \"ownership\": \"<string>\",\n \"company_mc\": 123,\n \"notes\": \"<string>\",\n \"driver_operator\": 123,\n \"co_driver_operator\": 123,\n \"reg_expiry_date\": \"2023-12-25\",\n \"last_annual_inspection_date\": \"2023-12-25\",\n \"owner\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{company}.datatruck.io/api/v1/openapi/trailers/create/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"unit_number\": \"<string>\",\n \"vin\": \"<string>\",\n \"plate_number\": \"<string>\",\n \"state\": \"<string>\",\n \"status\": \"<string>\",\n \"ownership\": \"<string>\",\n \"company_mc\": 123,\n \"notes\": \"<string>\",\n \"driver_operator\": 123,\n \"co_driver_operator\": 123,\n \"reg_expiry_date\": \"2023-12-25\",\n \"last_annual_inspection_date\": \"2023-12-25\",\n \"owner\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/trailers/create/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"unit_number\": \"<string>\",\n \"vin\": \"<string>\",\n \"plate_number\": \"<string>\",\n \"state\": \"<string>\",\n \"status\": \"<string>\",\n \"ownership\": \"<string>\",\n \"company_mc\": 123,\n \"notes\": \"<string>\",\n \"driver_operator\": 123,\n \"co_driver_operator\": 123,\n \"reg_expiry_date\": \"2023-12-25\",\n \"last_annual_inspection_date\": \"2023-12-25\",\n \"owner\": 123\n}"
response = http.request(request)
puts response.read_body{
"detail": "success"
}{
"error": 123,
"message": "<string>"
}Create trailer
Creates a new trailer with the provided details, including make, model, year, unit number, VIN, and optional fields such as plate number, state, status, and driver assignments.
curl --request POST \
--url https://{company}.datatruck.io/api/v1/openapi/trailers/create/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"make": "<string>",
"model": "<string>",
"year": 123,
"unit_number": "<string>",
"vin": "<string>",
"plate_number": "<string>",
"state": "<string>",
"status": "<string>",
"ownership": "<string>",
"company_mc": 123,
"notes": "<string>",
"driver_operator": 123,
"co_driver_operator": 123,
"reg_expiry_date": "2023-12-25",
"last_annual_inspection_date": "2023-12-25",
"owner": 123
}
'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/trailers/create/"
payload = {
"make": "<string>",
"model": "<string>",
"year": 123,
"unit_number": "<string>",
"vin": "<string>",
"plate_number": "<string>",
"state": "<string>",
"status": "<string>",
"ownership": "<string>",
"company_mc": 123,
"notes": "<string>",
"driver_operator": 123,
"co_driver_operator": 123,
"reg_expiry_date": "2023-12-25",
"last_annual_inspection_date": "2023-12-25",
"owner": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
make: '<string>',
model: '<string>',
year: 123,
unit_number: '<string>',
vin: '<string>',
plate_number: '<string>',
state: '<string>',
status: '<string>',
ownership: '<string>',
company_mc: 123,
notes: '<string>',
driver_operator: 123,
co_driver_operator: 123,
reg_expiry_date: '2023-12-25',
last_annual_inspection_date: '2023-12-25',
owner: 123
})
};
fetch('https://{company}.datatruck.io/api/v1/openapi/trailers/create/', 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/create/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'make' => '<string>',
'model' => '<string>',
'year' => 123,
'unit_number' => '<string>',
'vin' => '<string>',
'plate_number' => '<string>',
'state' => '<string>',
'status' => '<string>',
'ownership' => '<string>',
'company_mc' => 123,
'notes' => '<string>',
'driver_operator' => 123,
'co_driver_operator' => 123,
'reg_expiry_date' => '2023-12-25',
'last_annual_inspection_date' => '2023-12-25',
'owner' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{company}.datatruck.io/api/v1/openapi/trailers/create/"
payload := strings.NewReader("{\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"unit_number\": \"<string>\",\n \"vin\": \"<string>\",\n \"plate_number\": \"<string>\",\n \"state\": \"<string>\",\n \"status\": \"<string>\",\n \"ownership\": \"<string>\",\n \"company_mc\": 123,\n \"notes\": \"<string>\",\n \"driver_operator\": 123,\n \"co_driver_operator\": 123,\n \"reg_expiry_date\": \"2023-12-25\",\n \"last_annual_inspection_date\": \"2023-12-25\",\n \"owner\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{company}.datatruck.io/api/v1/openapi/trailers/create/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"unit_number\": \"<string>\",\n \"vin\": \"<string>\",\n \"plate_number\": \"<string>\",\n \"state\": \"<string>\",\n \"status\": \"<string>\",\n \"ownership\": \"<string>\",\n \"company_mc\": 123,\n \"notes\": \"<string>\",\n \"driver_operator\": 123,\n \"co_driver_operator\": 123,\n \"reg_expiry_date\": \"2023-12-25\",\n \"last_annual_inspection_date\": \"2023-12-25\",\n \"owner\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/trailers/create/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"unit_number\": \"<string>\",\n \"vin\": \"<string>\",\n \"plate_number\": \"<string>\",\n \"state\": \"<string>\",\n \"status\": \"<string>\",\n \"ownership\": \"<string>\",\n \"company_mc\": 123,\n \"notes\": \"<string>\",\n \"driver_operator\": 123,\n \"co_driver_operator\": 123,\n \"reg_expiry_date\": \"2023-12-25\",\n \"last_annual_inspection_date\": \"2023-12-25\",\n \"owner\": 123\n}"
response = http.request(request)
puts response.read_body{
"detail": "success"
}{
"error": 123,
"message": "<string>"
}Authorizations
Body
Manufacturer of the trailer.
Model of the trailer.
Manufacturing year of the trailer.
Unit number of the trailer.
Vehicle Identification Number (VIN) of the trailer.
Plate number of the trailer, if available.
State where the trailer is registered, if available.
Current status of the trailer, if applicable.
Ownership details of the trailer, if provided.
Company motor carrier number, if applicable.
Additional notes about the trailer, if provided.
ID of the primary driver operator assigned to the trailer, if any.
ID of the co-driver operator assigned to the trailer, if any.
Registration expiry date of the trailer, if provided.
Date of the last annual inspection, if provided.
ID of the owner of the trailer, if applicable.
Response
Trailer successfully created.
"success"