curl --request DELETE \
--url https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId} \
--header 'Authorization: Bearer <token>' \
--header 'sc-user-id: <sc-user-id>'import requests
url = "https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}"
headers = {
"sc-user-id": "<sc-user-id>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'sc-user-id': '<sc-user-id>', Authorization: 'Bearer <token>'}
};
fetch('https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}', 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/vehicles/{vehicleId}/charge-schedules/{scheduleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"sc-user-id: <sc-user-id>"
],
]);
$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/vehicles/{vehicleId}/charge-schedules/{scheduleId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("sc-user-id", "<sc-user-id>")
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.delete("https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}")
.header("sc-user-id", "<sc-user-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["sc-user-id"] = '<sc-user-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "exec_1234567890",
"type": "charge-schedule-execution",
"attributes": {
"action": "delete",
"status": {
"value": "SUCCESS"
},
"executionMode": "sync",
"scheduleId": "sched_abc123"
},
"meta": {
"executedAt": "2024-01-01T12:00:00Z",
"completedAt": "2024-01-01T12:00:02Z",
"durationInSeconds": 2
}
}
}Delete charge schedule
Deletes a charge schedule by schedule id. The deletion request is sent to the vehicle; the response confirms whether it succeeded.
curl --request DELETE \
--url https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId} \
--header 'Authorization: Bearer <token>' \
--header 'sc-user-id: <sc-user-id>'import requests
url = "https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}"
headers = {
"sc-user-id": "<sc-user-id>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'sc-user-id': '<sc-user-id>', Authorization: 'Bearer <token>'}
};
fetch('https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}', 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/vehicles/{vehicleId}/charge-schedules/{scheduleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"sc-user-id: <sc-user-id>"
],
]);
$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/vehicles/{vehicleId}/charge-schedules/{scheduleId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("sc-user-id", "<sc-user-id>")
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.delete("https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}")
.header("sc-user-id", "<sc-user-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/{scheduleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["sc-user-id"] = '<sc-user-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "exec_1234567890",
"type": "charge-schedule-execution",
"attributes": {
"action": "delete",
"status": {
"value": "SUCCESS"
},
"executionMode": "sync",
"scheduleId": "sched_abc123"
},
"meta": {
"executedAt": "2024-01-01T12:00:00Z",
"completedAt": "2024-01-01T12:00:02Z",
"durationInSeconds": 2
}
}
}Authorizations
The Authorization header must be provided with a valid bearer token.
Example: Authorization: Bearer {token}
Headers
The identifier of the vehicle user on whose behalf the command is being executed.
Vehicle commands require both the vehicleId (path) and sc-user-id (header) to
identify the specific vehicle and the user who has granted permission to act on it.
The bearer token is a machine-to-machine token and does not carry per-user context,
so this header must be provided explicitly for every command request.
Path Parameters
The unique identifier for the vehicle.
The unique identifier for the schedule to delete.
Response
200 OK - Schedule deleted synchronously
Response to a charge schedule create or delete request. data.attributes.action identifies the operation ("create" or "delete"). On success, data.attributes.scheduleId contains the id of the affected schedule. For "create", data.links.schedule contains the path to GET or DELETE the new resource.
Show child attributes
Show child attributes
Was this page helpful?

