Vehicles
Create one or more vehicles (max 100)
Scopes: vehicle:create
POST
/
v0
/
business
/
{business_id}
/
vehicles
Create one or more vehicles (max 100)
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"description": "<string>",
"external_id": "1234567890",
"make": "Ford",
"model": "F-150",
"year": 2019,
"license_plate": "ABC-1234",
"vin": "1FTEW1EP5KFA12345"
}
]
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles"
payload = [
{
"description": "<string>",
"external_id": "1234567890",
"make": "Ford",
"model": "F-150",
"year": 2019,
"license_plate": "ABC-1234",
"vin": "1FTEW1EP5KFA12345"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
description: '<string>',
external_id: '1234567890',
make: 'Ford',
model: 'F-150',
year: 2019,
license_plate: 'ABC-1234',
vin: '1FTEW1EP5KFA12345'
}
])
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles', 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://api.sandbox.getasset.com/v0/business/{business_id}/vehicles",
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([
[
'description' => '<string>',
'external_id' => '1234567890',
'make' => 'Ford',
'model' => 'F-150',
'year' => 2019,
'license_plate' => 'ABC-1234',
'vin' => '1FTEW1EP5KFA12345'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.sandbox.getasset.com/v0/business/{business_id}/vehicles"
payload := strings.NewReader("[\n {\n \"description\": \"<string>\",\n \"external_id\": \"1234567890\",\n \"make\": \"Ford\",\n \"model\": \"F-150\",\n \"year\": 2019,\n \"license_plate\": \"ABC-1234\",\n \"vin\": \"1FTEW1EP5KFA12345\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.sandbox.getasset.com/v0/business/{business_id}/vehicles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"description\": \"<string>\",\n \"external_id\": \"1234567890\",\n \"make\": \"Ford\",\n \"model\": \"F-150\",\n \"year\": 2019,\n \"license_plate\": \"ABC-1234\",\n \"vin\": \"1FTEW1EP5KFA12345\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"description\": \"<string>\",\n \"external_id\": \"1234567890\",\n \"make\": \"Ford\",\n \"model\": \"F-150\",\n \"year\": 2019,\n \"license_plate\": \"ABC-1234\",\n \"vin\": \"1FTEW1EP5KFA12345\"\n }\n]"
response = http.request(request)
puts response.read_body{
"data": [
{
"business_id": "<string>",
"description": "<string>",
"make": "Ford",
"model": "F-150",
"license_plate": "ABC-1234",
"vin": "1FTEW1EP5KFA12345",
"id": "<string>",
"external_id": "1234567890",
"year": 2019,
"is_active": true
}
],
"errors": [
{
"error": "<string>",
"external_id": "<string>"
}
]
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/json
Maximum array length:
100A human-readable description of the vehicle
Maximum string length:
255Example:
"2019 Ford F-150"
The external ID of the Vehicle
Maximum string length:
255Example:
"1234567890"
The make of the vehicle
Maximum string length:
255Example:
"Ford"
The model of the vehicle
Maximum string length:
255Example:
"F-150"
The model year of the vehicle
Example:
2019
The license plate of the vehicle
Maximum string length:
32Example:
"ABC-1234"
The Vehicle Identification Number
Maximum string length:
17Example:
"1FTEW1EP5KFA12345"
⌘I
Create one or more vehicles (max 100)
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"description": "<string>",
"external_id": "1234567890",
"make": "Ford",
"model": "F-150",
"year": 2019,
"license_plate": "ABC-1234",
"vin": "1FTEW1EP5KFA12345"
}
]
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles"
payload = [
{
"description": "<string>",
"external_id": "1234567890",
"make": "Ford",
"model": "F-150",
"year": 2019,
"license_plate": "ABC-1234",
"vin": "1FTEW1EP5KFA12345"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
description: '<string>',
external_id: '1234567890',
make: 'Ford',
model: 'F-150',
year: 2019,
license_plate: 'ABC-1234',
vin: '1FTEW1EP5KFA12345'
}
])
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles', 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://api.sandbox.getasset.com/v0/business/{business_id}/vehicles",
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([
[
'description' => '<string>',
'external_id' => '1234567890',
'make' => 'Ford',
'model' => 'F-150',
'year' => 2019,
'license_plate' => 'ABC-1234',
'vin' => '1FTEW1EP5KFA12345'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.sandbox.getasset.com/v0/business/{business_id}/vehicles"
payload := strings.NewReader("[\n {\n \"description\": \"<string>\",\n \"external_id\": \"1234567890\",\n \"make\": \"Ford\",\n \"model\": \"F-150\",\n \"year\": 2019,\n \"license_plate\": \"ABC-1234\",\n \"vin\": \"1FTEW1EP5KFA12345\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.sandbox.getasset.com/v0/business/{business_id}/vehicles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"description\": \"<string>\",\n \"external_id\": \"1234567890\",\n \"make\": \"Ford\",\n \"model\": \"F-150\",\n \"year\": 2019,\n \"license_plate\": \"ABC-1234\",\n \"vin\": \"1FTEW1EP5KFA12345\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"description\": \"<string>\",\n \"external_id\": \"1234567890\",\n \"make\": \"Ford\",\n \"model\": \"F-150\",\n \"year\": 2019,\n \"license_plate\": \"ABC-1234\",\n \"vin\": \"1FTEW1EP5KFA12345\"\n }\n]"
response = http.request(request)
puts response.read_body{
"data": [
{
"business_id": "<string>",
"description": "<string>",
"make": "Ford",
"model": "F-150",
"license_plate": "ABC-1234",
"vin": "1FTEW1EP5KFA12345",
"id": "<string>",
"external_id": "1234567890",
"year": 2019,
"is_active": true
}
],
"errors": [
{
"error": "<string>",
"external_id": "<string>"
}
]
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}