Get connection
curl --request GET \
--url https://vehicle.api.smartcar.com/v3/connections/{connectionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://vehicle.api.smartcar.com/v3/connections/{connectionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://vehicle.api.smartcar.com/v3/connections/{connectionId}', 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://vehicle.api.smartcar.com/v3/connections/{connectionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://vehicle.api.smartcar.com/v3/connections/{connectionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://vehicle.api.smartcar.com/v3/connections/{connectionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/connections/{connectionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "32c4139a-e4aa-4c6c-b357-3ae9022dbf1b",
"type": "connection",
"attributes": {
"permissions": [
"read_vehicle_info",
"read_odometer"
],
"vehicle": {
"make": "Tesla",
"model": "Model S",
"year": 2020,
"mode": "live",
"powertrainType": "BEV"
}
},
"relationships": {
"vehicle": {
"data": {
"id": "a6a425d6-c661-4b21-af7a-d6b75f80f3b0",
"type": "vehicle"
},
"links": {
"related": "https://api.example.com/vehicles/a6a425d6-c661-4b21-af7a-d6b75f80f3b0"
}
},
"user": {
"data": {
"id": "1e258add-fb21-4293-b9ab-cf8a61f7a880",
"type": "user"
}
}
},
"meta": {
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-02T00:00:00Z"
},
"links": {
"self": "https://api.example.com/connections/32c4139a-e4aa-4c6c-b357-3ae9022dbf1b"
}
}
}{
"errors": [
{
"status": "400",
"type": "VALIDATION",
"code": "BAD_REQUEST",
"title": "Bad Request",
"detail": "The request could not be understood by the server due to malformed syntax.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/validation-errors"
}
}
]
}{
"errors": [
{
"status": "401",
"type": "AUTHENTICATION",
"code": "UNAUTHORIZED",
"title": "Unauthorized",
"detail": "The Authorization token is missing or invalid.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors#authentication"
}
}
]
}{
"errors": [
{
"status": "403",
"type": "AUTHENTICATION",
"code": "FORBIDDEN",
"title": "Forbidden",
"detail": "You do not have permission to access this resource.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors"
}
}
]
}{
"errors": [
{
"status": "404",
"type": "RESOURCE_NOT_FOUND",
"code": "NOT_FOUND",
"title": "Not Found",
"detail": "The requested resource could not be found.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/resource-not-found-errors"
}
}
]
}{
"errors": [
{
"status": "500",
"type": "SERVER",
"code": "INTERNAL",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/server-errors"
}
}
]
}Connections
Get connection
Get a specific user/vehicle connection for the application
GET
/
connections
/
{connectionId}
Get connection
curl --request GET \
--url https://vehicle.api.smartcar.com/v3/connections/{connectionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://vehicle.api.smartcar.com/v3/connections/{connectionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://vehicle.api.smartcar.com/v3/connections/{connectionId}', 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://vehicle.api.smartcar.com/v3/connections/{connectionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://vehicle.api.smartcar.com/v3/connections/{connectionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://vehicle.api.smartcar.com/v3/connections/{connectionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/connections/{connectionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "32c4139a-e4aa-4c6c-b357-3ae9022dbf1b",
"type": "connection",
"attributes": {
"permissions": [
"read_vehicle_info",
"read_odometer"
],
"vehicle": {
"make": "Tesla",
"model": "Model S",
"year": 2020,
"mode": "live",
"powertrainType": "BEV"
}
},
"relationships": {
"vehicle": {
"data": {
"id": "a6a425d6-c661-4b21-af7a-d6b75f80f3b0",
"type": "vehicle"
},
"links": {
"related": "https://api.example.com/vehicles/a6a425d6-c661-4b21-af7a-d6b75f80f3b0"
}
},
"user": {
"data": {
"id": "1e258add-fb21-4293-b9ab-cf8a61f7a880",
"type": "user"
}
}
},
"meta": {
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-02T00:00:00Z"
},
"links": {
"self": "https://api.example.com/connections/32c4139a-e4aa-4c6c-b357-3ae9022dbf1b"
}
}
}{
"errors": [
{
"status": "400",
"type": "VALIDATION",
"code": "BAD_REQUEST",
"title": "Bad Request",
"detail": "The request could not be understood by the server due to malformed syntax.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/validation-errors"
}
}
]
}{
"errors": [
{
"status": "401",
"type": "AUTHENTICATION",
"code": "UNAUTHORIZED",
"title": "Unauthorized",
"detail": "The Authorization token is missing or invalid.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors#authentication"
}
}
]
}{
"errors": [
{
"status": "403",
"type": "AUTHENTICATION",
"code": "FORBIDDEN",
"title": "Forbidden",
"detail": "You do not have permission to access this resource.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors"
}
}
]
}{
"errors": [
{
"status": "404",
"type": "RESOURCE_NOT_FOUND",
"code": "NOT_FOUND",
"title": "Not Found",
"detail": "The requested resource could not be found.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/resource-not-found-errors"
}
}
]
}{
"errors": [
{
"status": "500",
"type": "SERVER",
"code": "INTERNAL",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/server-errors"
}
}
]
}Authorizations
The Authorization header must be provided with a valid bearer token.
Example: Authorization: Bearer {token}
Path Parameters
The unique identifier for the connection
Response
Get a specific user/vehicle connection for the application
Show child attributes
Show child attributes
Was this page helpful?
⌘I

