API Reference
Preview Fleet
POST
/
api
/
partners
/
v2.0
/
org
/
{org_id}
/
device-simulator
/
fleets
/
preview
Preview Fleet
curl --request POST \
--url https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Simulated fleet",
"count": 10,
"seed": 42,
"history_days": 0,
"history_cutoff": "2023-11-07T05:31:56Z",
"latitude": 0,
"longitude": 0,
"density": {
"country": "<string>",
"dataset_version": "<string>",
"boundary_version": "<string>",
"grid": {
"origin_lat": 0,
"origin_lon": 0,
"cell_deg": 0,
"rows": 2000,
"cols": 2000
},
"weights": "<string>"
},
"ev_ownership_fraction": 0.25,
"pv_rating_kw": 50,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 50000,
"max_discharge_power_w": 50000,
"initial_soc_percent": 52.5,
"pv_rating_kw_range": {
"min": 123,
"max": 123
},
"battery_capacity_kwh_range": {
"min": 123,
"max": 123
},
"initial_soc_percent_range": {
"min": 123,
"max": 123
},
"max_charge_power_w_range": {
"min": 123,
"max": 123
},
"max_discharge_power_w_range": {
"min": 123,
"max": 123
},
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"groups": [
{
"name": "<string>",
"count": 500,
"percentage": 50,
"profile": "mixed",
"weights": [
123
],
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"max_time_shift_minutes": 90,
"variation_fraction": 0.25
}
]
}
'import requests
url = "https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview"
payload = {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Simulated fleet",
"count": 10,
"seed": 42,
"history_days": 0,
"history_cutoff": "2023-11-07T05:31:56Z",
"latitude": 0,
"longitude": 0,
"density": {
"country": "<string>",
"dataset_version": "<string>",
"boundary_version": "<string>",
"grid": {
"origin_lat": 0,
"origin_lon": 0,
"cell_deg": 0,
"rows": 2000,
"cols": 2000
},
"weights": "<string>"
},
"ev_ownership_fraction": 0.25,
"pv_rating_kw": 50,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 50000,
"max_discharge_power_w": 50000,
"initial_soc_percent": 52.5,
"pv_rating_kw_range": {
"min": 123,
"max": 123
},
"battery_capacity_kwh_range": {
"min": 123,
"max": 123
},
"initial_soc_percent_range": {
"min": 123,
"max": 123
},
"max_charge_power_w_range": {
"min": 123,
"max": 123
},
"max_discharge_power_w_range": {
"min": 123,
"max": 123
},
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"groups": [
{
"name": "<string>",
"count": 500,
"percentage": 50,
"profile": "mixed",
"weights": [123],
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"max_time_shift_minutes": 90,
"variation_fraction": 0.25
}
]
}
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({
request_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Simulated fleet',
count: 10,
seed: 42,
history_days: 0,
history_cutoff: '2023-11-07T05:31:56Z',
latitude: 0,
longitude: 0,
density: {
country: '<string>',
dataset_version: '<string>',
boundary_version: '<string>',
grid: {origin_lat: 0, origin_lon: 0, cell_deg: 0, rows: 2000, cols: 2000},
weights: '<string>'
},
ev_ownership_fraction: 0.25,
pv_rating_kw: 50,
battery_capacity_kwh: 500.05,
max_charge_power_w: 50000,
max_discharge_power_w: 50000,
initial_soc_percent: 52.5,
pv_rating_kw_range: {min: 123, max: 123},
battery_capacity_kwh_range: {min: 123, max: 123},
initial_soc_percent_range: {min: 123, max: 123},
max_charge_power_w_range: {min: 123, max: 123},
max_discharge_power_w_range: {min: 123, max: 123},
annual_consumption_kwh: 50000.5,
annual_consumption_with_ev_kwh: 50000.5,
groups: [
{
name: '<string>',
count: 500,
percentage: 50,
profile: 'mixed',
weights: [123],
annual_consumption_kwh: 50000.5,
annual_consumption_with_ev_kwh: 50000.5,
max_time_shift_minutes: 90,
variation_fraction: 0.25
}
]
})
};
fetch('https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview', 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.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview",
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([
'request_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Simulated fleet',
'count' => 10,
'seed' => 42,
'history_days' => 0,
'history_cutoff' => '2023-11-07T05:31:56Z',
'latitude' => 0,
'longitude' => 0,
'density' => [
'country' => '<string>',
'dataset_version' => '<string>',
'boundary_version' => '<string>',
'grid' => [
'origin_lat' => 0,
'origin_lon' => 0,
'cell_deg' => 0,
'rows' => 2000,
'cols' => 2000
],
'weights' => '<string>'
],
'ev_ownership_fraction' => 0.25,
'pv_rating_kw' => 50,
'battery_capacity_kwh' => 500.05,
'max_charge_power_w' => 50000,
'max_discharge_power_w' => 50000,
'initial_soc_percent' => 52.5,
'pv_rating_kw_range' => [
'min' => 123,
'max' => 123
],
'battery_capacity_kwh_range' => [
'min' => 123,
'max' => 123
],
'initial_soc_percent_range' => [
'min' => 123,
'max' => 123
],
'max_charge_power_w_range' => [
'min' => 123,
'max' => 123
],
'max_discharge_power_w_range' => [
'min' => 123,
'max' => 123
],
'annual_consumption_kwh' => 50000.5,
'annual_consumption_with_ev_kwh' => 50000.5,
'groups' => [
[
'name' => '<string>',
'count' => 500,
'percentage' => 50,
'profile' => 'mixed',
'weights' => [
123
],
'annual_consumption_kwh' => 50000.5,
'annual_consumption_with_ev_kwh' => 50000.5,
'max_time_shift_minutes' => 90,
'variation_fraction' => 0.25
]
]
]),
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.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview"
payload := strings.NewReader("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Simulated fleet\",\n \"count\": 10,\n \"seed\": 42,\n \"history_days\": 0,\n \"history_cutoff\": \"2023-11-07T05:31:56Z\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"density\": {\n \"country\": \"<string>\",\n \"dataset_version\": \"<string>\",\n \"boundary_version\": \"<string>\",\n \"grid\": {\n \"origin_lat\": 0,\n \"origin_lon\": 0,\n \"cell_deg\": 0,\n \"rows\": 2000,\n \"cols\": 2000\n },\n \"weights\": \"<string>\"\n },\n \"ev_ownership_fraction\": 0.25,\n \"pv_rating_kw\": 50,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 50000,\n \"max_discharge_power_w\": 50000,\n \"initial_soc_percent\": 52.5,\n \"pv_rating_kw_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"battery_capacity_kwh_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"initial_soc_percent_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_charge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_discharge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"count\": 500,\n \"percentage\": 50,\n \"profile\": \"mixed\",\n \"weights\": [\n 123\n ],\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"max_time_shift_minutes\": 90,\n \"variation_fraction\": 0.25\n }\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.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Simulated fleet\",\n \"count\": 10,\n \"seed\": 42,\n \"history_days\": 0,\n \"history_cutoff\": \"2023-11-07T05:31:56Z\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"density\": {\n \"country\": \"<string>\",\n \"dataset_version\": \"<string>\",\n \"boundary_version\": \"<string>\",\n \"grid\": {\n \"origin_lat\": 0,\n \"origin_lon\": 0,\n \"cell_deg\": 0,\n \"rows\": 2000,\n \"cols\": 2000\n },\n \"weights\": \"<string>\"\n },\n \"ev_ownership_fraction\": 0.25,\n \"pv_rating_kw\": 50,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 50000,\n \"max_discharge_power_w\": 50000,\n \"initial_soc_percent\": 52.5,\n \"pv_rating_kw_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"battery_capacity_kwh_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"initial_soc_percent_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_charge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_discharge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"count\": 500,\n \"percentage\": 50,\n \"profile\": \"mixed\",\n \"weights\": [\n 123\n ],\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"max_time_shift_minutes\": 90,\n \"variation_fraction\": 0.25\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview")
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 \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Simulated fleet\",\n \"count\": 10,\n \"seed\": 42,\n \"history_days\": 0,\n \"history_cutoff\": \"2023-11-07T05:31:56Z\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"density\": {\n \"country\": \"<string>\",\n \"dataset_version\": \"<string>\",\n \"boundary_version\": \"<string>\",\n \"grid\": {\n \"origin_lat\": 0,\n \"origin_lon\": 0,\n \"cell_deg\": 0,\n \"rows\": 2000,\n \"cols\": 2000\n },\n \"weights\": \"<string>\"\n },\n \"ev_ownership_fraction\": 0.25,\n \"pv_rating_kw\": 50,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 50000,\n \"max_discharge_power_w\": 50000,\n \"initial_soc_percent\": 52.5,\n \"pv_rating_kw_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"battery_capacity_kwh_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"initial_soc_percent_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_charge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_discharge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"count\": 500,\n \"percentage\": 50,\n \"profile\": \"mixed\",\n \"weights\": [\n 123\n ],\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"max_time_shift_minutes\": 90,\n \"variation_fraction\": 0.25\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/json
Required string length:
1 - 120Pattern:
\SRequired range:
1 <= x <= 1000Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 90Required range:
-90 <= x <= 90Required range:
-180 <= x <= 180Painted household density for one country. The Go contract holds the full rules; these checks stop malformed payloads before a runtime call and give the Console field-level errors.
Show child attributes
Show child attributes
Required range:
0 <= x <= 1Required range:
0 <= x <= 100Required range:
0.1 <= x <= 1000Required range:
1 <= x <= 100000Required range:
1 <= x <= 100000Required range:
5 <= x <= 100Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
1 <= x <= 100000Required range:
1 <= x <= 100000Maximum array length:
100Show child attributes
Show child attributes
Response
200
OK
Was this page helpful?
⌘I
Preview Fleet
curl --request POST \
--url https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Simulated fleet",
"count": 10,
"seed": 42,
"history_days": 0,
"history_cutoff": "2023-11-07T05:31:56Z",
"latitude": 0,
"longitude": 0,
"density": {
"country": "<string>",
"dataset_version": "<string>",
"boundary_version": "<string>",
"grid": {
"origin_lat": 0,
"origin_lon": 0,
"cell_deg": 0,
"rows": 2000,
"cols": 2000
},
"weights": "<string>"
},
"ev_ownership_fraction": 0.25,
"pv_rating_kw": 50,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 50000,
"max_discharge_power_w": 50000,
"initial_soc_percent": 52.5,
"pv_rating_kw_range": {
"min": 123,
"max": 123
},
"battery_capacity_kwh_range": {
"min": 123,
"max": 123
},
"initial_soc_percent_range": {
"min": 123,
"max": 123
},
"max_charge_power_w_range": {
"min": 123,
"max": 123
},
"max_discharge_power_w_range": {
"min": 123,
"max": 123
},
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"groups": [
{
"name": "<string>",
"count": 500,
"percentage": 50,
"profile": "mixed",
"weights": [
123
],
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"max_time_shift_minutes": 90,
"variation_fraction": 0.25
}
]
}
'import requests
url = "https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview"
payload = {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Simulated fleet",
"count": 10,
"seed": 42,
"history_days": 0,
"history_cutoff": "2023-11-07T05:31:56Z",
"latitude": 0,
"longitude": 0,
"density": {
"country": "<string>",
"dataset_version": "<string>",
"boundary_version": "<string>",
"grid": {
"origin_lat": 0,
"origin_lon": 0,
"cell_deg": 0,
"rows": 2000,
"cols": 2000
},
"weights": "<string>"
},
"ev_ownership_fraction": 0.25,
"pv_rating_kw": 50,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 50000,
"max_discharge_power_w": 50000,
"initial_soc_percent": 52.5,
"pv_rating_kw_range": {
"min": 123,
"max": 123
},
"battery_capacity_kwh_range": {
"min": 123,
"max": 123
},
"initial_soc_percent_range": {
"min": 123,
"max": 123
},
"max_charge_power_w_range": {
"min": 123,
"max": 123
},
"max_discharge_power_w_range": {
"min": 123,
"max": 123
},
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"groups": [
{
"name": "<string>",
"count": 500,
"percentage": 50,
"profile": "mixed",
"weights": [123],
"annual_consumption_kwh": 50000.5,
"annual_consumption_with_ev_kwh": 50000.5,
"max_time_shift_minutes": 90,
"variation_fraction": 0.25
}
]
}
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({
request_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Simulated fleet',
count: 10,
seed: 42,
history_days: 0,
history_cutoff: '2023-11-07T05:31:56Z',
latitude: 0,
longitude: 0,
density: {
country: '<string>',
dataset_version: '<string>',
boundary_version: '<string>',
grid: {origin_lat: 0, origin_lon: 0, cell_deg: 0, rows: 2000, cols: 2000},
weights: '<string>'
},
ev_ownership_fraction: 0.25,
pv_rating_kw: 50,
battery_capacity_kwh: 500.05,
max_charge_power_w: 50000,
max_discharge_power_w: 50000,
initial_soc_percent: 52.5,
pv_rating_kw_range: {min: 123, max: 123},
battery_capacity_kwh_range: {min: 123, max: 123},
initial_soc_percent_range: {min: 123, max: 123},
max_charge_power_w_range: {min: 123, max: 123},
max_discharge_power_w_range: {min: 123, max: 123},
annual_consumption_kwh: 50000.5,
annual_consumption_with_ev_kwh: 50000.5,
groups: [
{
name: '<string>',
count: 500,
percentage: 50,
profile: 'mixed',
weights: [123],
annual_consumption_kwh: 50000.5,
annual_consumption_with_ev_kwh: 50000.5,
max_time_shift_minutes: 90,
variation_fraction: 0.25
}
]
})
};
fetch('https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview', 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.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview",
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([
'request_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Simulated fleet',
'count' => 10,
'seed' => 42,
'history_days' => 0,
'history_cutoff' => '2023-11-07T05:31:56Z',
'latitude' => 0,
'longitude' => 0,
'density' => [
'country' => '<string>',
'dataset_version' => '<string>',
'boundary_version' => '<string>',
'grid' => [
'origin_lat' => 0,
'origin_lon' => 0,
'cell_deg' => 0,
'rows' => 2000,
'cols' => 2000
],
'weights' => '<string>'
],
'ev_ownership_fraction' => 0.25,
'pv_rating_kw' => 50,
'battery_capacity_kwh' => 500.05,
'max_charge_power_w' => 50000,
'max_discharge_power_w' => 50000,
'initial_soc_percent' => 52.5,
'pv_rating_kw_range' => [
'min' => 123,
'max' => 123
],
'battery_capacity_kwh_range' => [
'min' => 123,
'max' => 123
],
'initial_soc_percent_range' => [
'min' => 123,
'max' => 123
],
'max_charge_power_w_range' => [
'min' => 123,
'max' => 123
],
'max_discharge_power_w_range' => [
'min' => 123,
'max' => 123
],
'annual_consumption_kwh' => 50000.5,
'annual_consumption_with_ev_kwh' => 50000.5,
'groups' => [
[
'name' => '<string>',
'count' => 500,
'percentage' => 50,
'profile' => 'mixed',
'weights' => [
123
],
'annual_consumption_kwh' => 50000.5,
'annual_consumption_with_ev_kwh' => 50000.5,
'max_time_shift_minutes' => 90,
'variation_fraction' => 0.25
]
]
]),
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.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview"
payload := strings.NewReader("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Simulated fleet\",\n \"count\": 10,\n \"seed\": 42,\n \"history_days\": 0,\n \"history_cutoff\": \"2023-11-07T05:31:56Z\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"density\": {\n \"country\": \"<string>\",\n \"dataset_version\": \"<string>\",\n \"boundary_version\": \"<string>\",\n \"grid\": {\n \"origin_lat\": 0,\n \"origin_lon\": 0,\n \"cell_deg\": 0,\n \"rows\": 2000,\n \"cols\": 2000\n },\n \"weights\": \"<string>\"\n },\n \"ev_ownership_fraction\": 0.25,\n \"pv_rating_kw\": 50,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 50000,\n \"max_discharge_power_w\": 50000,\n \"initial_soc_percent\": 52.5,\n \"pv_rating_kw_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"battery_capacity_kwh_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"initial_soc_percent_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_charge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_discharge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"count\": 500,\n \"percentage\": 50,\n \"profile\": \"mixed\",\n \"weights\": [\n 123\n ],\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"max_time_shift_minutes\": 90,\n \"variation_fraction\": 0.25\n }\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.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Simulated fleet\",\n \"count\": 10,\n \"seed\": 42,\n \"history_days\": 0,\n \"history_cutoff\": \"2023-11-07T05:31:56Z\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"density\": {\n \"country\": \"<string>\",\n \"dataset_version\": \"<string>\",\n \"boundary_version\": \"<string>\",\n \"grid\": {\n \"origin_lat\": 0,\n \"origin_lon\": 0,\n \"cell_deg\": 0,\n \"rows\": 2000,\n \"cols\": 2000\n },\n \"weights\": \"<string>\"\n },\n \"ev_ownership_fraction\": 0.25,\n \"pv_rating_kw\": 50,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 50000,\n \"max_discharge_power_w\": 50000,\n \"initial_soc_percent\": 52.5,\n \"pv_rating_kw_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"battery_capacity_kwh_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"initial_soc_percent_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_charge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_discharge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"count\": 500,\n \"percentage\": 50,\n \"profile\": \"mixed\",\n \"weights\": [\n 123\n ],\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"max_time_shift_minutes\": 90,\n \"variation_fraction\": 0.25\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/fleets/preview")
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 \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Simulated fleet\",\n \"count\": 10,\n \"seed\": 42,\n \"history_days\": 0,\n \"history_cutoff\": \"2023-11-07T05:31:56Z\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"density\": {\n \"country\": \"<string>\",\n \"dataset_version\": \"<string>\",\n \"boundary_version\": \"<string>\",\n \"grid\": {\n \"origin_lat\": 0,\n \"origin_lon\": 0,\n \"cell_deg\": 0,\n \"rows\": 2000,\n \"cols\": 2000\n },\n \"weights\": \"<string>\"\n },\n \"ev_ownership_fraction\": 0.25,\n \"pv_rating_kw\": 50,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 50000,\n \"max_discharge_power_w\": 50000,\n \"initial_soc_percent\": 52.5,\n \"pv_rating_kw_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"battery_capacity_kwh_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"initial_soc_percent_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_charge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"max_discharge_power_w_range\": {\n \"min\": 123,\n \"max\": 123\n },\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"count\": 500,\n \"percentage\": 50,\n \"profile\": \"mixed\",\n \"weights\": [\n 123\n ],\n \"annual_consumption_kwh\": 50000.5,\n \"annual_consumption_with_ev_kwh\": 50000.5,\n \"max_time_shift_minutes\": 90,\n \"variation_fraction\": 0.25\n }\n ]\n}"
response = http.request(request)
puts response.read_body