Creates a plug
curl --request POST \
--url https://api.chargecloud.dev/api/v1/assets/plugs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chargepoint_id": 1,
"type_id": 1,
"ampere": 1,
"voltage": 1,
"max_power": 1,
"active": true,
"fixable": true,
"with_cable": false,
"cable_length": 1,
"export": false,
"comment": "<string>",
"serial_number": "<string>",
"article_number": "<string>"
}
'import requests
url = "https://api.chargecloud.dev/api/v1/assets/plugs"
payload = {
"chargepoint_id": 1,
"type_id": 1,
"ampere": 1,
"voltage": 1,
"max_power": 1,
"active": True,
"fixable": True,
"with_cable": False,
"cable_length": 1,
"export": False,
"comment": "<string>",
"serial_number": "<string>",
"article_number": "<string>"
}
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({
chargepoint_id: 1,
type_id: 1,
ampere: 1,
voltage: 1,
max_power: 1,
active: true,
fixable: true,
with_cable: false,
cable_length: 1,
export: false,
comment: '<string>',
serial_number: '<string>',
article_number: '<string>'
})
};
fetch('https://api.chargecloud.dev/api/v1/assets/plugs', 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.chargecloud.dev/api/v1/assets/plugs",
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([
'chargepoint_id' => 1,
'type_id' => 1,
'ampere' => 1,
'voltage' => 1,
'max_power' => 1,
'active' => true,
'fixable' => true,
'with_cable' => false,
'cable_length' => 1,
'export' => false,
'comment' => '<string>',
'serial_number' => '<string>',
'article_number' => '<string>'
]),
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.chargecloud.dev/api/v1/assets/plugs"
payload := strings.NewReader("{\n \"chargepoint_id\": 1,\n \"type_id\": 1,\n \"ampere\": 1,\n \"voltage\": 1,\n \"max_power\": 1,\n \"active\": true,\n \"fixable\": true,\n \"with_cable\": false,\n \"cable_length\": 1,\n \"export\": false,\n \"comment\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"article_number\": \"<string>\"\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.chargecloud.dev/api/v1/assets/plugs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chargepoint_id\": 1,\n \"type_id\": 1,\n \"ampere\": 1,\n \"voltage\": 1,\n \"max_power\": 1,\n \"active\": true,\n \"fixable\": true,\n \"with_cable\": false,\n \"cable_length\": 1,\n \"export\": false,\n \"comment\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"article_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chargecloud.dev/api/v1/assets/plugs")
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 \"chargepoint_id\": 1,\n \"type_id\": 1,\n \"ampere\": 1,\n \"voltage\": 1,\n \"max_power\": 1,\n \"active\": true,\n \"fixable\": true,\n \"with_cable\": false,\n \"cable_length\": 1,\n \"export\": false,\n \"comment\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"article_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"plug": {
"id": 123,
"created_at": "2023-12-25",
"updated_at": "2023-12-25",
"chargepoint_id": 1,
"type_id": 1,
"ampere": 1,
"voltage": 1,
"max_power": 1,
"active": true,
"fixable": true,
"with_cable": false,
"cable_length": 1,
"export": false,
"comment": "<string>",
"serial_number": "<string>",
"article_number": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"errors": [
{
"errorKey": "<string>",
"message": "<string>",
"parameter": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Plugs
Creates a plug
Creates a plug. Required permission: assets:plug:create
POST
/
api
/
v1
/
assets
/
plugs
Creates a plug
curl --request POST \
--url https://api.chargecloud.dev/api/v1/assets/plugs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chargepoint_id": 1,
"type_id": 1,
"ampere": 1,
"voltage": 1,
"max_power": 1,
"active": true,
"fixable": true,
"with_cable": false,
"cable_length": 1,
"export": false,
"comment": "<string>",
"serial_number": "<string>",
"article_number": "<string>"
}
'import requests
url = "https://api.chargecloud.dev/api/v1/assets/plugs"
payload = {
"chargepoint_id": 1,
"type_id": 1,
"ampere": 1,
"voltage": 1,
"max_power": 1,
"active": True,
"fixable": True,
"with_cable": False,
"cable_length": 1,
"export": False,
"comment": "<string>",
"serial_number": "<string>",
"article_number": "<string>"
}
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({
chargepoint_id: 1,
type_id: 1,
ampere: 1,
voltage: 1,
max_power: 1,
active: true,
fixable: true,
with_cable: false,
cable_length: 1,
export: false,
comment: '<string>',
serial_number: '<string>',
article_number: '<string>'
})
};
fetch('https://api.chargecloud.dev/api/v1/assets/plugs', 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.chargecloud.dev/api/v1/assets/plugs",
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([
'chargepoint_id' => 1,
'type_id' => 1,
'ampere' => 1,
'voltage' => 1,
'max_power' => 1,
'active' => true,
'fixable' => true,
'with_cable' => false,
'cable_length' => 1,
'export' => false,
'comment' => '<string>',
'serial_number' => '<string>',
'article_number' => '<string>'
]),
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.chargecloud.dev/api/v1/assets/plugs"
payload := strings.NewReader("{\n \"chargepoint_id\": 1,\n \"type_id\": 1,\n \"ampere\": 1,\n \"voltage\": 1,\n \"max_power\": 1,\n \"active\": true,\n \"fixable\": true,\n \"with_cable\": false,\n \"cable_length\": 1,\n \"export\": false,\n \"comment\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"article_number\": \"<string>\"\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.chargecloud.dev/api/v1/assets/plugs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chargepoint_id\": 1,\n \"type_id\": 1,\n \"ampere\": 1,\n \"voltage\": 1,\n \"max_power\": 1,\n \"active\": true,\n \"fixable\": true,\n \"with_cable\": false,\n \"cable_length\": 1,\n \"export\": false,\n \"comment\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"article_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chargecloud.dev/api/v1/assets/plugs")
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 \"chargepoint_id\": 1,\n \"type_id\": 1,\n \"ampere\": 1,\n \"voltage\": 1,\n \"max_power\": 1,\n \"active\": true,\n \"fixable\": true,\n \"with_cable\": false,\n \"cable_length\": 1,\n \"export\": false,\n \"comment\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"article_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"plug": {
"id": 123,
"created_at": "2023-12-25",
"updated_at": "2023-12-25",
"chargepoint_id": 1,
"type_id": 1,
"ampere": 1,
"voltage": 1,
"max_power": 1,
"active": true,
"fixable": true,
"with_cable": false,
"cable_length": 1,
"export": false,
"comment": "<string>",
"serial_number": "<string>",
"article_number": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"errors": [
{
"errorKey": "<string>",
"message": "<string>",
"parameter": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
OAuth2 Bearer Authorization
Body
application/json
Creates a plug. Required permission: assets:plug:create
chargepoint id
Required range:
x >= 0Plug type id
Required range:
x >= 0Phase of the plug
Available options:
ac1, ac3, dc Ampere of the plug
Required range:
x >= 0Voltage of the plug
Required range:
x >= 0Maximum power of the plug
Required range:
x >= 0Status of the plug
Is the plug fixable
Is the plug with a fixed cable
Plugs cable length
Required range:
x >= 0Should the plug be shown in external APIs
Internal comments for the plug
Maximum string length:
255Serial number of the plug
Maximum string length:
25Article number of the plug
Maximum string length:
25Response
Plug created
Plug
Show child attributes
Show child attributes
Was this page helpful?
⌘I