Device Simulator
Create Simulated Device
POST
/
api
/
partners
/
v2.0
/
org
/
{org_id}
/
device-simulator
/
devices
Create Simulated Device
curl --request POST \
--url https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"device_type": "inv",
"name": "Simulated inverter",
"household_profile": "mixed",
"has_ev": true,
"history_days": 0,
"pv_rating_kw": 500,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 500000,
"max_discharge_power_w": 500000,
"initial_soc_percent": 50,
"annual_consumption_kwh": 500000,
"annual_consumption_with_ev_kwh": 500000
}
'import requests
url = "https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices"
payload = {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"device_type": "inv",
"name": "Simulated inverter",
"household_profile": "mixed",
"has_ev": True,
"history_days": 0,
"pv_rating_kw": 500,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 500000,
"max_discharge_power_w": 500000,
"initial_soc_percent": 50,
"annual_consumption_kwh": 500000,
"annual_consumption_with_ev_kwh": 500000
}
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',
device_type: 'inv',
name: 'Simulated inverter',
household_profile: 'mixed',
has_ev: true,
history_days: 0,
pv_rating_kw: 500,
battery_capacity_kwh: 500.05,
max_charge_power_w: 500000,
max_discharge_power_w: 500000,
initial_soc_percent: 50,
annual_consumption_kwh: 500000,
annual_consumption_with_ev_kwh: 500000
})
};
fetch('https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices', 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/devices",
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',
'device_type' => 'inv',
'name' => 'Simulated inverter',
'household_profile' => 'mixed',
'has_ev' => true,
'history_days' => 0,
'pv_rating_kw' => 500,
'battery_capacity_kwh' => 500.05,
'max_charge_power_w' => 500000,
'max_discharge_power_w' => 500000,
'initial_soc_percent' => 50,
'annual_consumption_kwh' => 500000,
'annual_consumption_with_ev_kwh' => 500000
]),
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/devices"
payload := strings.NewReader("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"device_type\": \"inv\",\n \"name\": \"Simulated inverter\",\n \"household_profile\": \"mixed\",\n \"has_ev\": true,\n \"history_days\": 0,\n \"pv_rating_kw\": 500,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 500000,\n \"max_discharge_power_w\": 500000,\n \"initial_soc_percent\": 50,\n \"annual_consumption_kwh\": 500000,\n \"annual_consumption_with_ev_kwh\": 500000\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/devices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"device_type\": \"inv\",\n \"name\": \"Simulated inverter\",\n \"household_profile\": \"mixed\",\n \"has_ev\": true,\n \"history_days\": 0,\n \"pv_rating_kw\": 500,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 500000,\n \"max_discharge_power_w\": 500000,\n \"initial_soc_percent\": 50,\n \"annual_consumption_kwh\": 500000,\n \"annual_consumption_with_ev_kwh\": 500000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices")
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 \"device_type\": \"inv\",\n \"name\": \"Simulated inverter\",\n \"household_profile\": \"mixed\",\n \"has_ev\": true,\n \"history_days\": 0,\n \"pv_rating_kw\": 500,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 500000,\n \"max_discharge_power_w\": 500000,\n \"initial_soc_percent\": 50,\n \"annual_consumption_kwh\": 500000,\n \"annual_consumption_with_ev_kwh\": 500000\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
Allowed value:
"inv"Required string length:
1 - 120Pattern:
\SRequired string length:
1 - 64Required range:
0 <= x <= 90Required range:
0 <= x <= 1000Required range:
0.1 <= x <= 1000Required range:
0 <= x <= 1000000Required range:
0 <= x <= 1000000Required range:
0 <= x <= 100Required range:
0 < x <= 1000000Required range:
0 < x <= 1000000Response
200
OK
Was this page helpful?
⌘I
Create Simulated Device
curl --request POST \
--url https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"device_type": "inv",
"name": "Simulated inverter",
"household_profile": "mixed",
"has_ev": true,
"history_days": 0,
"pv_rating_kw": 500,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 500000,
"max_discharge_power_w": 500000,
"initial_soc_percent": 50,
"annual_consumption_kwh": 500000,
"annual_consumption_with_ev_kwh": 500000
}
'import requests
url = "https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices"
payload = {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"device_type": "inv",
"name": "Simulated inverter",
"household_profile": "mixed",
"has_ev": True,
"history_days": 0,
"pv_rating_kw": 500,
"battery_capacity_kwh": 500.05,
"max_charge_power_w": 500000,
"max_discharge_power_w": 500000,
"initial_soc_percent": 50,
"annual_consumption_kwh": 500000,
"annual_consumption_with_ev_kwh": 500000
}
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',
device_type: 'inv',
name: 'Simulated inverter',
household_profile: 'mixed',
has_ev: true,
history_days: 0,
pv_rating_kw: 500,
battery_capacity_kwh: 500.05,
max_charge_power_w: 500000,
max_discharge_power_w: 500000,
initial_soc_percent: 50,
annual_consumption_kwh: 500000,
annual_consumption_with_ev_kwh: 500000
})
};
fetch('https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices', 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/devices",
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',
'device_type' => 'inv',
'name' => 'Simulated inverter',
'household_profile' => 'mixed',
'has_ev' => true,
'history_days' => 0,
'pv_rating_kw' => 500,
'battery_capacity_kwh' => 500.05,
'max_charge_power_w' => 500000,
'max_discharge_power_w' => 500000,
'initial_soc_percent' => 50,
'annual_consumption_kwh' => 500000,
'annual_consumption_with_ev_kwh' => 500000
]),
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/devices"
payload := strings.NewReader("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"device_type\": \"inv\",\n \"name\": \"Simulated inverter\",\n \"household_profile\": \"mixed\",\n \"has_ev\": true,\n \"history_days\": 0,\n \"pv_rating_kw\": 500,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 500000,\n \"max_discharge_power_w\": 500000,\n \"initial_soc_percent\": 50,\n \"annual_consumption_kwh\": 500000,\n \"annual_consumption_with_ev_kwh\": 500000\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/devices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"device_type\": \"inv\",\n \"name\": \"Simulated inverter\",\n \"household_profile\": \"mixed\",\n \"has_ev\": true,\n \"history_days\": 0,\n \"pv_rating_kw\": 500,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 500000,\n \"max_discharge_power_w\": 500000,\n \"initial_soc_percent\": 50,\n \"annual_consumption_kwh\": 500000,\n \"annual_consumption_with_ev_kwh\": 500000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/partners/v2.0/org/{org_id}/device-simulator/devices")
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 \"device_type\": \"inv\",\n \"name\": \"Simulated inverter\",\n \"household_profile\": \"mixed\",\n \"has_ev\": true,\n \"history_days\": 0,\n \"pv_rating_kw\": 500,\n \"battery_capacity_kwh\": 500.05,\n \"max_charge_power_w\": 500000,\n \"max_discharge_power_w\": 500000,\n \"initial_soc_percent\": 50,\n \"annual_consumption_kwh\": 500000,\n \"annual_consumption_with_ev_kwh\": 500000\n}"
response = http.request(request)
puts response.read_body