curl --request GET \
--url https://vehicle.api.smartcar.com/v3/command-executions/{executionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://vehicle.api.smartcar.com/v3/command-executions/{executionId}"
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/command-executions/{executionId}', 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/command-executions/{executionId}",
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/command-executions/{executionId}"
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/command-executions/{executionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/command-executions/{executionId}")
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": "exec_u30M8e5ErKC8wPc5t3uTXw",
"type": "command-execution",
"attributes": {
"commandType": "charge-start",
"status": {
"value": "SUCCESS"
},
"executionMode": "sync",
"userId": "user_789xyz",
"vehicleId": "36ab27d0-fd9d-4455-823a-ce30af709ffc"
},
"links": {
"self": "https://vehicle.api.smartcar.com/v3/command-executions/exec_u30M8e5ErKC8wPc5t3uTXw"
},
"meta": {
"executedAt": "2024-01-01T12:00:00Z",
"requestId": "3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d",
"completedAt": "2024-01-01T12:00:02Z",
"durationInSeconds": 2
}
}
}Get command execution
Returns the recorded state of a previously issued vehicle command, identified by its execution id. The execution of any operation issued by the calling application can be read, regardless of the user or vehicle it was issued for. Every command response includes this endpoint’s URL in data.links.self, so follow that link to check an operation’s status, or to follow the operation named in meta.blockingOperation of an OPERATION_IN_PROGRESS error.
When a request returns 202, its Location header holds this endpoint’s URL, and its outcome is available only here. Poll this endpoint every Retry-After seconds until status.value is no longer PENDING. Every operation reaches a final status, so this loop always ends. Today that takes at most about 5 minutes from meta.executedAt, but the limit may change, so don’t rely on a fixed timeout. If meta.requestId no longer matches the one you received, the execution now describes a newer operation, and yours has finished.
A status.value of EXPIRED means the operation didn’t record a result within the time allowed, so the outcome is unknown: it may or may not have taken effect on the vehicle. It no longer blocks other requests, so you can retry it.
An execution is kept for at least 30 days after its most recent operation. After it is removed, this endpoint returns 404.
curl --request GET \
--url https://vehicle.api.smartcar.com/v3/command-executions/{executionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://vehicle.api.smartcar.com/v3/command-executions/{executionId}"
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/command-executions/{executionId}', 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/command-executions/{executionId}",
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/command-executions/{executionId}"
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/command-executions/{executionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/command-executions/{executionId}")
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": "exec_u30M8e5ErKC8wPc5t3uTXw",
"type": "command-execution",
"attributes": {
"commandType": "charge-start",
"status": {
"value": "SUCCESS"
},
"executionMode": "sync",
"userId": "user_789xyz",
"vehicleId": "36ab27d0-fd9d-4455-823a-ce30af709ffc"
},
"links": {
"self": "https://vehicle.api.smartcar.com/v3/command-executions/exec_u30M8e5ErKC8wPc5t3uTXw"
},
"meta": {
"executedAt": "2024-01-01T12:00:00Z",
"requestId": "3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d",
"completedAt": "2024-01-01T12:00:02Z",
"durationInSeconds": 2
}
}
}Authorizations
Path Parameters
Was this page helpful?

