curl --request PUT \
--url https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"newName": "SE6F1K2C3"
}
'import requests
url = "https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename"
payload = { "newName": "SE6F1K2C3" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({newName: 'SE6F1K2C3'})
};
fetch('https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename', 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://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'newName' => 'SE6F1K2C3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename"
payload := strings.NewReader("{\n \"newName\": \"SE6F1K2C3\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.put("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"newName\": \"SE6F1K2C3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"newName\": \"SE6F1K2C3\"\n}"
response = http.request(request)
puts response.read_body{
"name": "SE6F1K2C3",
"keyIdentifier": "3633e0e0",
"validTo": "2022-01-24T11:25:54.210Z",
"fleetId": "y1nNLJqb7m",
"contractId": "DE-9FS-C045DS363-E",
"visualNumber": "6285629402937",
"enabled": true,
"whitelist": "NEVER"
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}Rename a charging key
Renames a charging key given its key identifier
curl --request PUT \
--url https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"newName": "SE6F1K2C3"
}
'import requests
url = "https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename"
payload = { "newName": "SE6F1K2C3" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({newName: 'SE6F1K2C3'})
};
fetch('https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename', 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://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'newName' => 'SE6F1K2C3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename"
payload := strings.NewReader("{\n \"newName\": \"SE6F1K2C3\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.put("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"newName\": \"SE6F1K2C3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/rename")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"newName\": \"SE6F1K2C3\"\n}"
response = http.request(request)
puts response.read_body{
"name": "SE6F1K2C3",
"keyIdentifier": "3633e0e0",
"validTo": "2022-01-24T11:25:54.210Z",
"fleetId": "y1nNLJqb7m",
"contractId": "DE-9FS-C045DS363-E",
"visualNumber": "6285629402937",
"enabled": true,
"whitelist": "NEVER"
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Path Parameters
keyIdentifier provided when creating the charging key
Body
Request payload to rename an EMP charging key.
New name of the Charging key
"SE6F1K2C3"
Response
Succeed
EMP charging key details returned by key management endpoints.
Name of the Charging key
"SE6F1K2C3"
Charging key identifier in hexadecimal, little-endian format with usually 8 or 14 characters.
"3633e0e0"
UTC timestamp when the charging key expires.
"2022-01-24T11:25:54.210Z"
Fleet id
"y1nNLJqb7m"
Charging key contract id
"DE-9FS-C045DS363-E"
Identifier printed on the physical key
"6285629402937"
Charging key is enabled or disabled
true
Defines whether the CPO may allow a session for this charging key when it cannot get a response from the EMP, or must always rely on realtime authorization from the EMP. Possible values: ALLOWED_OFFLINE, NEVER.
ALLOWED_OFFLINE, NEVER "NEVER"