API Reference
Send intent
Send notification of an intent being updated on an asset.
POST
/
entities
/
asset
/
{asset_id}
/
event
/
intent
Asset Intent Update Event
curl --request POST \
--url https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"intent": {
"energy_required_kwh": 123,
"ready_by": "2023-11-07T05:31:56Z",
"ready_by_local_time": "<string>",
"energy_estimated": true,
"may_charge_peak": false,
"charging_mode": "maximise_charging_time"
}
}
'import requests
url = "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent"
payload = { "intent": {
"energy_required_kwh": 123,
"ready_by": "2023-11-07T05:31:56Z",
"ready_by_local_time": "<string>",
"energy_estimated": True,
"may_charge_peak": False,
"charging_mode": "maximise_charging_time"
} }
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({
intent: {
energy_required_kwh: 123,
ready_by: '2023-11-07T05:31:56Z',
ready_by_local_time: '<string>',
energy_estimated: true,
may_charge_peak: false,
charging_mode: 'maximise_charging_time'
}
})
};
fetch('https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent', 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-sandbox.axle.energy/entities/asset/{asset_id}/event/intent",
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([
'intent' => [
'energy_required_kwh' => 123,
'ready_by' => '2023-11-07T05:31:56Z',
'ready_by_local_time' => '<string>',
'energy_estimated' => true,
'may_charge_peak' => false,
'charging_mode' => 'maximise_charging_time'
]
]),
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://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent"
payload := strings.NewReader("{\n \"intent\": {\n \"energy_required_kwh\": 123,\n \"ready_by\": \"2023-11-07T05:31:56Z\",\n \"ready_by_local_time\": \"<string>\",\n \"energy_estimated\": true,\n \"may_charge_peak\": false,\n \"charging_mode\": \"maximise_charging_time\"\n }\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://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"intent\": {\n \"energy_required_kwh\": 123,\n \"ready_by\": \"2023-11-07T05:31:56Z\",\n \"ready_by_local_time\": \"<string>\",\n \"energy_estimated\": true,\n \"may_charge_peak\": false,\n \"charging_mode\": \"maximise_charging_time\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent")
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 \"intent\": {\n \"energy_required_kwh\": 123,\n \"ready_by\": \"2023-11-07T05:31:56Z\",\n \"ready_by_local_time\": \"<string>\",\n \"energy_estimated\": true,\n \"may_charge_peak\": false,\n \"charging_mode\": \"maximise_charging_time\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/json
This event should be triggered when the end user updates their charging preferences.
Intent to charge the vehicle.
Show child attributes
Show child attributes
Response
Intent event successfully processed
Was this page helpful?
Previous
Send tariffSend notification of a tariff update for an asset.
The `off_peak_times` field must comply with the OSM opening hours standard (https://wiki.openstreetmap.org/wiki/Key:opening_hours) and have a valid timezone, or a 400 error will be returned.
The same off-peak times apply every day, day-of-week selectors are not supported. Use `,` to separate multiple time ranges. Common examples:
- Same-day off-peak (e.g. midnight to 7am): `00:00-07:00`
- Overnight off-peak (e.g. 11:30pm to 5:30am): `00:00-05:30, 23:30-24:00`
Next
⌘I
Asset Intent Update Event
curl --request POST \
--url https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"intent": {
"energy_required_kwh": 123,
"ready_by": "2023-11-07T05:31:56Z",
"ready_by_local_time": "<string>",
"energy_estimated": true,
"may_charge_peak": false,
"charging_mode": "maximise_charging_time"
}
}
'import requests
url = "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent"
payload = { "intent": {
"energy_required_kwh": 123,
"ready_by": "2023-11-07T05:31:56Z",
"ready_by_local_time": "<string>",
"energy_estimated": True,
"may_charge_peak": False,
"charging_mode": "maximise_charging_time"
} }
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({
intent: {
energy_required_kwh: 123,
ready_by: '2023-11-07T05:31:56Z',
ready_by_local_time: '<string>',
energy_estimated: true,
may_charge_peak: false,
charging_mode: 'maximise_charging_time'
}
})
};
fetch('https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent', 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-sandbox.axle.energy/entities/asset/{asset_id}/event/intent",
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([
'intent' => [
'energy_required_kwh' => 123,
'ready_by' => '2023-11-07T05:31:56Z',
'ready_by_local_time' => '<string>',
'energy_estimated' => true,
'may_charge_peak' => false,
'charging_mode' => 'maximise_charging_time'
]
]),
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://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent"
payload := strings.NewReader("{\n \"intent\": {\n \"energy_required_kwh\": 123,\n \"ready_by\": \"2023-11-07T05:31:56Z\",\n \"ready_by_local_time\": \"<string>\",\n \"energy_estimated\": true,\n \"may_charge_peak\": false,\n \"charging_mode\": \"maximise_charging_time\"\n }\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://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"intent\": {\n \"energy_required_kwh\": 123,\n \"ready_by\": \"2023-11-07T05:31:56Z\",\n \"ready_by_local_time\": \"<string>\",\n \"energy_estimated\": true,\n \"may_charge_peak\": false,\n \"charging_mode\": \"maximise_charging_time\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/intent")
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 \"intent\": {\n \"energy_required_kwh\": 123,\n \"ready_by\": \"2023-11-07T05:31:56Z\",\n \"ready_by_local_time\": \"<string>\",\n \"energy_estimated\": true,\n \"may_charge_peak\": false,\n \"charging_mode\": \"maximise_charging_time\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
