All vehicles
curl --request GET \
--url https://api.energy-hub.io/v1.0.0/vehicles \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.energy-hub.io/v1.0.0/vehicles"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.energy-hub.io/v1.0.0/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.energy-hub.io/v1.0.0/vehicles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <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://api.energy-hub.io/v1.0.0/vehicles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<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://api.energy-hub.io/v1.0.0/vehicles")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.energy-hub.io/v1.0.0/vehicles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totalPages": 1,
"content": [
{
"vendor": "TESLA",
"name": "My Tesla",
"vin": "1XKAD29X0KS502460",
"isOnline": true,
"id": "6eb5497d-c6bb-4290-84ef-4409fe9501f1",
"userId": "896f9d5a-b618-48a2-98ae-957059bf1bc9",
"lastUpdated": "2023-11-07T05:31:56Z",
"model": "Model 3"
}
],
"totalElements": 1
}{
"errorCode": "BAD_REQUEST",
"validationErrors": [
{
"field": "Affected field",
"message": "Validation message"
}
],
"id": "cae58230-364d-45ca-b67d-08a57653c59f",
"message": "Bad request"
}{
"errorCode": "UNAUTHORIZED",
"id": "cae58230-364d-45ca-b67d-08a57653c59f",
"message": "Unauthorized"
}Vehicle
All vehicles
Returns a paginated and searchable list of all vehicles of the subscription.
GET
/
v1.0.0
/
vehicles
All vehicles
curl --request GET \
--url https://api.energy-hub.io/v1.0.0/vehicles \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.energy-hub.io/v1.0.0/vehicles"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.energy-hub.io/v1.0.0/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.energy-hub.io/v1.0.0/vehicles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <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://api.energy-hub.io/v1.0.0/vehicles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<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://api.energy-hub.io/v1.0.0/vehicles")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.energy-hub.io/v1.0.0/vehicles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"totalPages": 1,
"content": [
{
"vendor": "TESLA",
"name": "My Tesla",
"vin": "1XKAD29X0KS502460",
"isOnline": true,
"id": "6eb5497d-c6bb-4290-84ef-4409fe9501f1",
"userId": "896f9d5a-b618-48a2-98ae-957059bf1bc9",
"lastUpdated": "2023-11-07T05:31:56Z",
"model": "Model 3"
}
],
"totalElements": 1
}{
"errorCode": "BAD_REQUEST",
"validationErrors": [
{
"field": "Affected field",
"message": "Validation message"
}
],
"id": "cae58230-364d-45ca-b67d-08a57653c59f",
"message": "Bad request"
}{
"errorCode": "UNAUTHORIZED",
"id": "cae58230-364d-45ca-b67d-08a57653c59f",
"message": "Unauthorized"
}Authorizations
API key used for authorization and authentication.
Query Parameters
Sorting field. Default value is USER_ID
Available options:
USER_ID, VENDOR, IS_ONLINE, LAST_UPDATED Search by vehicle UUID
Search by user ID (partial match, case-insensitive)
Search by vehicle VIN (partial match, case-insensitive)
Filter by online status
Search by vehicle display name (partial match, case-insensitive)
Filter by vendor
Available options:
TESLA, MERCEDES, BMW, MINI, VW, AUDI, SKODA, VOLVO, CUPRA Search by vehicle model (partial match, case-insensitive)
Filter by UTC last updated date (from this date onwards).
Filter by UTC last updated date (To this date).
Sorting order. Default value is DESC.
Available options:
ASC, DESC Zero-based page index (0..N)
Required range:
x >= 0The size of the page to be returned. Default value is 10. Maximum value is 100.
Required range:
1 <= x <= 100
