Vehicles
Update a vehicle
Scopes: vehicle:update
PATCH
/
v0
/
business
/
{business_id}
/
vehicles
/
{vehicle_id}
Update a vehicle
curl --request PATCH \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"description": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"is_active": true
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}"
payload = {
"external_id": "<string>",
"description": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
description: '<string>',
make: '<string>',
model: '<string>',
year: 123,
license_plate: '<string>',
vin: '<string>',
is_active: true
})
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}', 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/{vehicle_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'description' => '<string>',
'make' => '<string>',
'model' => '<string>',
'year' => 123,
'license_plate' => '<string>',
'vin' => '<string>',
'is_active' => true
]),
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/{vehicle_id}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"description\": \"<string>\",\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"description\": \"<string>\",\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"description\": \"<string>\",\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"is_active\": true\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
}
}{
"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.
Body
application/json
The external ID of the Vehicle
Maximum string length:
255A human-readable description of the vehicle
Maximum string length:
255The make of the vehicle
Maximum string length:
255The model of the vehicle
Maximum string length:
255The model year of the vehicle
The license plate of the vehicle
Maximum string length:
32The Vehicle Identification Number
Maximum string length:
17Whether the vehicle is active
Response
Successful Response
Show child attributes
Show child attributes
⌘I
Update a vehicle
curl --request PATCH \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"description": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"is_active": true
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}"
payload = {
"external_id": "<string>",
"description": "<string>",
"make": "<string>",
"model": "<string>",
"year": 123,
"license_plate": "<string>",
"vin": "<string>",
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
description: '<string>',
make: '<string>',
model: '<string>',
year: 123,
license_plate: '<string>',
vin: '<string>',
is_active: true
})
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}', 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/{vehicle_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'description' => '<string>',
'make' => '<string>',
'model' => '<string>',
'year' => 123,
'license_plate' => '<string>',
'vin' => '<string>',
'is_active' => true
]),
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/{vehicle_id}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"description\": \"<string>\",\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"description\": \"<string>\",\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/vehicles/{vehicle_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"description\": \"<string>\",\n \"make\": \"<string>\",\n \"model\": \"<string>\",\n \"year\": 123,\n \"license_plate\": \"<string>\",\n \"vin\": \"<string>\",\n \"is_active\": true\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
}
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}