vehicles
Create Vehicle
Create or update a vehicle
POST
/
api
/
v1
/
vehicles
Create Vehicle
curl --request POST \
--url https://www.manglai.io/api/v1/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"type": "<string>",
"companyId": "<string>",
"buildingId": "<string>",
"licencePlate": "<string>",
"vehicleCategoryId": "<string>",
"motorType": "<string>",
"fuelTypeId": "<string>",
"transportType": "<string>",
"vehicleTransportSize": "<string>",
"control": "<string>",
"operationalControl": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"brand": "<string>",
"class": "<string>",
"model": "<string>",
"removedAt": "2023-11-07T05:31:56Z",
"isGeneric": true
}
'import requests
url = "https://www.manglai.io/api/v1/vehicles"
payload = {
"id": "<string>",
"type": "<string>",
"companyId": "<string>",
"buildingId": "<string>",
"licencePlate": "<string>",
"vehicleCategoryId": "<string>",
"motorType": "<string>",
"fuelTypeId": "<string>",
"transportType": "<string>",
"vehicleTransportSize": "<string>",
"control": "<string>",
"operationalControl": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"brand": "<string>",
"class": "<string>",
"model": "<string>",
"removedAt": "2023-11-07T05:31:56Z",
"isGeneric": True
}
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({
id: '<string>',
type: '<string>',
companyId: '<string>',
buildingId: '<string>',
licencePlate: '<string>',
vehicleCategoryId: '<string>',
motorType: '<string>',
fuelTypeId: '<string>',
transportType: '<string>',
vehicleTransportSize: '<string>',
control: '<string>',
operationalControl: '<string>',
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z',
brand: '<string>',
class: '<string>',
model: '<string>',
removedAt: '2023-11-07T05:31:56Z',
isGeneric: true
})
};
fetch('https://www.manglai.io/api/v1/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://www.manglai.io/api/v1/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([
'id' => '<string>',
'type' => '<string>',
'companyId' => '<string>',
'buildingId' => '<string>',
'licencePlate' => '<string>',
'vehicleCategoryId' => '<string>',
'motorType' => '<string>',
'fuelTypeId' => '<string>',
'transportType' => '<string>',
'vehicleTransportSize' => '<string>',
'control' => '<string>',
'operationalControl' => '<string>',
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z',
'brand' => '<string>',
'class' => '<string>',
'model' => '<string>',
'removedAt' => '2023-11-07T05:31:56Z',
'isGeneric' => 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://www.manglai.io/api/v1/vehicles"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"companyId\": \"<string>\",\n \"buildingId\": \"<string>\",\n \"licencePlate\": \"<string>\",\n \"vehicleCategoryId\": \"<string>\",\n \"motorType\": \"<string>\",\n \"fuelTypeId\": \"<string>\",\n \"transportType\": \"<string>\",\n \"vehicleTransportSize\": \"<string>\",\n \"control\": \"<string>\",\n \"operationalControl\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"brand\": \"<string>\",\n \"class\": \"<string>\",\n \"model\": \"<string>\",\n \"removedAt\": \"2023-11-07T05:31:56Z\",\n \"isGeneric\": true\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://www.manglai.io/api/v1/vehicles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"companyId\": \"<string>\",\n \"buildingId\": \"<string>\",\n \"licencePlate\": \"<string>\",\n \"vehicleCategoryId\": \"<string>\",\n \"motorType\": \"<string>\",\n \"fuelTypeId\": \"<string>\",\n \"transportType\": \"<string>\",\n \"vehicleTransportSize\": \"<string>\",\n \"control\": \"<string>\",\n \"operationalControl\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"brand\": \"<string>\",\n \"class\": \"<string>\",\n \"model\": \"<string>\",\n \"removedAt\": \"2023-11-07T05:31:56Z\",\n \"isGeneric\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.manglai.io/api/v1/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 \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"companyId\": \"<string>\",\n \"buildingId\": \"<string>\",\n \"licencePlate\": \"<string>\",\n \"vehicleCategoryId\": \"<string>\",\n \"motorType\": \"<string>\",\n \"fuelTypeId\": \"<string>\",\n \"transportType\": \"<string>\",\n \"vehicleTransportSize\": \"<string>\",\n \"control\": \"<string>\",\n \"operationalControl\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"brand\": \"<string>\",\n \"class\": \"<string>\",\n \"model\": \"<string>\",\n \"removedAt\": \"2023-11-07T05:31:56Z\",\n \"isGeneric\": true\n}"
response = http.request(request)
puts response.read_bodyAutorizaciones
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Cuerpo
application/json
Respuesta
200
Vehicle created or updated
⌘I
Create Vehicle
curl --request POST \
--url https://www.manglai.io/api/v1/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"type": "<string>",
"companyId": "<string>",
"buildingId": "<string>",
"licencePlate": "<string>",
"vehicleCategoryId": "<string>",
"motorType": "<string>",
"fuelTypeId": "<string>",
"transportType": "<string>",
"vehicleTransportSize": "<string>",
"control": "<string>",
"operationalControl": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"brand": "<string>",
"class": "<string>",
"model": "<string>",
"removedAt": "2023-11-07T05:31:56Z",
"isGeneric": true
}
'import requests
url = "https://www.manglai.io/api/v1/vehicles"
payload = {
"id": "<string>",
"type": "<string>",
"companyId": "<string>",
"buildingId": "<string>",
"licencePlate": "<string>",
"vehicleCategoryId": "<string>",
"motorType": "<string>",
"fuelTypeId": "<string>",
"transportType": "<string>",
"vehicleTransportSize": "<string>",
"control": "<string>",
"operationalControl": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"brand": "<string>",
"class": "<string>",
"model": "<string>",
"removedAt": "2023-11-07T05:31:56Z",
"isGeneric": True
}
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({
id: '<string>',
type: '<string>',
companyId: '<string>',
buildingId: '<string>',
licencePlate: '<string>',
vehicleCategoryId: '<string>',
motorType: '<string>',
fuelTypeId: '<string>',
transportType: '<string>',
vehicleTransportSize: '<string>',
control: '<string>',
operationalControl: '<string>',
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z',
brand: '<string>',
class: '<string>',
model: '<string>',
removedAt: '2023-11-07T05:31:56Z',
isGeneric: true
})
};
fetch('https://www.manglai.io/api/v1/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://www.manglai.io/api/v1/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([
'id' => '<string>',
'type' => '<string>',
'companyId' => '<string>',
'buildingId' => '<string>',
'licencePlate' => '<string>',
'vehicleCategoryId' => '<string>',
'motorType' => '<string>',
'fuelTypeId' => '<string>',
'transportType' => '<string>',
'vehicleTransportSize' => '<string>',
'control' => '<string>',
'operationalControl' => '<string>',
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z',
'brand' => '<string>',
'class' => '<string>',
'model' => '<string>',
'removedAt' => '2023-11-07T05:31:56Z',
'isGeneric' => 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://www.manglai.io/api/v1/vehicles"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"companyId\": \"<string>\",\n \"buildingId\": \"<string>\",\n \"licencePlate\": \"<string>\",\n \"vehicleCategoryId\": \"<string>\",\n \"motorType\": \"<string>\",\n \"fuelTypeId\": \"<string>\",\n \"transportType\": \"<string>\",\n \"vehicleTransportSize\": \"<string>\",\n \"control\": \"<string>\",\n \"operationalControl\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"brand\": \"<string>\",\n \"class\": \"<string>\",\n \"model\": \"<string>\",\n \"removedAt\": \"2023-11-07T05:31:56Z\",\n \"isGeneric\": true\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://www.manglai.io/api/v1/vehicles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"companyId\": \"<string>\",\n \"buildingId\": \"<string>\",\n \"licencePlate\": \"<string>\",\n \"vehicleCategoryId\": \"<string>\",\n \"motorType\": \"<string>\",\n \"fuelTypeId\": \"<string>\",\n \"transportType\": \"<string>\",\n \"vehicleTransportSize\": \"<string>\",\n \"control\": \"<string>\",\n \"operationalControl\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"brand\": \"<string>\",\n \"class\": \"<string>\",\n \"model\": \"<string>\",\n \"removedAt\": \"2023-11-07T05:31:56Z\",\n \"isGeneric\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.manglai.io/api/v1/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 \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"companyId\": \"<string>\",\n \"buildingId\": \"<string>\",\n \"licencePlate\": \"<string>\",\n \"vehicleCategoryId\": \"<string>\",\n \"motorType\": \"<string>\",\n \"fuelTypeId\": \"<string>\",\n \"transportType\": \"<string>\",\n \"vehicleTransportSize\": \"<string>\",\n \"control\": \"<string>\",\n \"operationalControl\": \"<string>\",\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"brand\": \"<string>\",\n \"class\": \"<string>\",\n \"model\": \"<string>\",\n \"removedAt\": \"2023-11-07T05:31:56Z\",\n \"isGeneric\": true\n}"
response = http.request(request)
puts response.read_body
