Reserve a charging key
curl --request POST \
--url https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"amount": 5,
"countryCode": "DE",
"products": [
"RFID_CARD"
],
"userId": "6f36dc9b-446f-462b-aae0-95c7636d5c6c",
"language": "en"
}
'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations"
payload = {
"amount": 5,
"countryCode": "DE",
"products": ["RFID_CARD"],
"userId": "6f36dc9b-446f-462b-aae0-95c7636d5c6c",
"language": "en"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5,
countryCode: 'DE',
products: ['RFID_CARD'],
userId: '6f36dc9b-446f-462b-aae0-95c7636d5c6c',
language: 'en'
})
};
fetch('https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations', 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/drive/v1/charging-keys/reservations",
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([
'amount' => 5,
'countryCode' => 'DE',
'products' => [
'RFID_CARD'
],
'userId' => '6f36dc9b-446f-462b-aae0-95c7636d5c6c',
'language' => 'en'
]),
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/drive/v1/charging-keys/reservations"
payload := strings.NewReader("{\n \"amount\": 5,\n \"countryCode\": \"DE\",\n \"products\": [\n \"RFID_CARD\"\n ],\n \"userId\": \"6f36dc9b-446f-462b-aae0-95c7636d5c6c\",\n \"language\": \"en\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5,\n \"countryCode\": \"DE\",\n \"products\": [\n \"RFID_CARD\"\n ],\n \"userId\": \"6f36dc9b-446f-462b-aae0-95c7636d5c6c\",\n \"language\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5,\n \"countryCode\": \"DE\",\n \"products\": [\n \"RFID_CARD\"\n ],\n \"userId\": \"6f36dc9b-446f-462b-aae0-95c7636d5c6c\",\n \"language\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}Charging keys
Reserve a charging key
Create connection between uid (physical chip id) and visualNumber (called later ‘referenceId’), so that the latter can be used for activation.
POST
/
drive
/
v1
/
charging-keys
/
reservations
Reserve a charging key
curl --request POST \
--url https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"amount": 5,
"countryCode": "DE",
"products": [
"RFID_CARD"
],
"userId": "6f36dc9b-446f-462b-aae0-95c7636d5c6c",
"language": "en"
}
'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations"
payload = {
"amount": 5,
"countryCode": "DE",
"products": ["RFID_CARD"],
"userId": "6f36dc9b-446f-462b-aae0-95c7636d5c6c",
"language": "en"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5,
countryCode: 'DE',
products: ['RFID_CARD'],
userId: '6f36dc9b-446f-462b-aae0-95c7636d5c6c',
language: 'en'
})
};
fetch('https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations', 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/drive/v1/charging-keys/reservations",
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([
'amount' => 5,
'countryCode' => 'DE',
'products' => [
'RFID_CARD'
],
'userId' => '6f36dc9b-446f-462b-aae0-95c7636d5c6c',
'language' => 'en'
]),
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/drive/v1/charging-keys/reservations"
payload := strings.NewReader("{\n \"amount\": 5,\n \"countryCode\": \"DE\",\n \"products\": [\n \"RFID_CARD\"\n ],\n \"userId\": \"6f36dc9b-446f-462b-aae0-95c7636d5c6c\",\n \"language\": \"en\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5,\n \"countryCode\": \"DE\",\n \"products\": [\n \"RFID_CARD\"\n ],\n \"userId\": \"6f36dc9b-446f-462b-aae0-95c7636d5c6c\",\n \"language\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/charging-keys/reservations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5,\n \"countryCode\": \"DE\",\n \"products\": [\n \"RFID_CARD\"\n ],\n \"userId\": \"6f36dc9b-446f-462b-aae0-95c7636d5c6c\",\n \"language\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Body
application/json
Request payload to reserve charging key identifiers before activation.
Physical chip id. Must be in hexadecimal, little endian format
Example:
"e0e03306"
Human-readable identifier written on the rfid card or tag
Example:
"DE*8PS*FR1RFK*4"
default - current date
Example:
"2022-01-24T11:25:54.210Z"
default - 10 years from 'validFrom' date
Example:
"2032-01-24T11:25:54.210Z"
this value is just for reference, it has no practical implications
Available options:
CARD, TAG Example:
"CARD"
Response
Created