Send one bounded OCPI command through an owned registered connection
curl --request POST \
--url https://chargerdojo.com/api/v1/testing/command \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "<string>",
"endpoint": "<string>",
"body": "<unknown>",
"expectedStatus": 123
}
'import requests
url = "https://chargerdojo.com/api/v1/testing/command"
payload = {
"connectionId": "<string>",
"endpoint": "<string>",
"body": "<unknown>",
"expectedStatus": 123
}
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({
connectionId: '<string>',
endpoint: '<string>',
body: JSON.stringify('<unknown>'),
expectedStatus: 123
})
};
fetch('https://chargerdojo.com/api/v1/testing/command', 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://chargerdojo.com/api/v1/testing/command",
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([
'connectionId' => '<string>',
'endpoint' => '<string>',
'body' => '<unknown>',
'expectedStatus' => 123
]),
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://chargerdojo.com/api/v1/testing/command"
payload := strings.NewReader("{\n \"connectionId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"body\": \"<unknown>\",\n \"expectedStatus\": 123\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://chargerdojo.com/api/v1/testing/command")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connectionId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"body\": \"<unknown>\",\n \"expectedStatus\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chargerdojo.com/api/v1/testing/command")
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 \"connectionId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"body\": \"<unknown>\",\n \"expectedStatus\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"passed": true,
"actualStatus": 123,
"exchange": {
"request": {
"method": "<string>",
"url": "<string>",
"headers": {},
"headersTruncated": true,
"body": "<unknown>",
"bodyTruncated": true
},
"response": {
"status": 123,
"headers": {},
"headersTruncated": true,
"body": "<unknown>",
"bodyTruncated": true
},
"latencyMs": 123,
"error": "<string>",
"errorTruncated": true
}
},
"meta": {
"limit": 123,
"skip": 123,
"nextCursor": "<string>"
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}Testing
Send an OCPI command
Send a single OCPI command through a registered connection you own and read back the raw HTTP status, OCPI status code and response body.
POST
/
testing
/
command
Send one bounded OCPI command through an owned registered connection
curl --request POST \
--url https://chargerdojo.com/api/v1/testing/command \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "<string>",
"endpoint": "<string>",
"body": "<unknown>",
"expectedStatus": 123
}
'import requests
url = "https://chargerdojo.com/api/v1/testing/command"
payload = {
"connectionId": "<string>",
"endpoint": "<string>",
"body": "<unknown>",
"expectedStatus": 123
}
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({
connectionId: '<string>',
endpoint: '<string>',
body: JSON.stringify('<unknown>'),
expectedStatus: 123
})
};
fetch('https://chargerdojo.com/api/v1/testing/command', 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://chargerdojo.com/api/v1/testing/command",
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([
'connectionId' => '<string>',
'endpoint' => '<string>',
'body' => '<unknown>',
'expectedStatus' => 123
]),
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://chargerdojo.com/api/v1/testing/command"
payload := strings.NewReader("{\n \"connectionId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"body\": \"<unknown>\",\n \"expectedStatus\": 123\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://chargerdojo.com/api/v1/testing/command")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connectionId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"body\": \"<unknown>\",\n \"expectedStatus\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chargerdojo.com/api/v1/testing/command")
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 \"connectionId\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"body\": \"<unknown>\",\n \"expectedStatus\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"passed": true,
"actualStatus": 123,
"exchange": {
"request": {
"method": "<string>",
"url": "<string>",
"headers": {},
"headersTruncated": true,
"body": "<unknown>",
"bodyTruncated": true
},
"response": {
"status": 123,
"headers": {},
"headersTruncated": true,
"body": "<unknown>",
"bodyTruncated": true
},
"latencyMs": 123,
"error": "<string>",
"errorTruncated": true
}
},
"meta": {
"limit": 123,
"skip": 123,
"nextCursor": "<string>"
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}{
"success": false,
"message": "<string>",
"status": "error",
"code": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"capability": "external-endpoints",
"limit": {
"id": "connections",
"used": 123,
"cap": 123
}
}Authorizations
A cdojo_... API key created in the app under Settings.
Body
application/json
Available options:
GET, POST, PUT, PATCH, DELETE Module-relative OCPI path, for example /commands/START_SESSION.
Request body for write methods.
The status you expect, or every status the spec permits here. Omit it and any 2xx or 3xx passes.