- Reference
- OCPI 2.2.1 (eMSP)
- Receiver Session
OpenAPI reference
Receiver Session
/sessions/{country_code}/{party_id}/{session_id}Retrieve a Session object from the receiver's system.
API: OCPI 2.2.1 (eMSP) · Module: Sessions (eMSP)
Base path:/sessions· Base URL:https://ocpi-api.gridos.co/ocpi/emsp/2.2.1
Overview
GET /sessions/{country_code}/{party_id}/{session_id}Absolute URL: https://ocpi-api.gridos.co/ocpi/emsp/2.2.1/sessions/{country_code}/{party_id}/{session_id}
Retrieve a Session object from the receiver's system.
Requires authentication. Use Authorization: Token <token>. See OCPI credentials.
How to call
Quick Shell sample (set OCPI_TOKEN when auth is required). Full Python and TypeScript under Examples.
curl -sS -X GET 'https://ocpi-api.gridos.co/ocpi/emsp/2.2.1/sessions/NL/ABC/SESSION1' \
-H "Authorization: Token $OCPI_TOKEN"Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | Yes | ISO-3166 alpha-2 country code (uppercase). |
party_id | string | Yes | CPO/eMSP party ID (ISO-15118, 3 uppercase alphanumerics). |
session_id | string | Yes | Session.id of the Session object. |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | SessionResponse |
401 | Unauthorized | — |
404 | Not Found | — |
422 | Validation Error | HTTPValidationError |
200 — successful response
application/json
Schema: SessionResponse
| Field | Type | Required | Description |
|---|---|---|---|
status_code | integer | No | Default: 1000 |
status_message | string | No | — |
timestamp | string (date-time) | No | — |
data | SessionOut | No | SessionOut |
Response example
{
"status_code": 1000,
"status_message": "Success",
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"auth_method": "WHITELIST",
"authorization_reference": "AUTH-REF-001",
"cdr_token": {
"contract_id": "NL-TNM-012345678905880-S",
"country_code": "NL",
"party_id": "TNM",
"type": "RFID",
"uid": "012345678905880"
},
"charging_periods": [
{
"dimensions": [
{
"type": "ENERGY",
"volume": 15.32
}
],
"start_date_time": "2024-01-15T10:00:00Z",
"tariff_id": "TARIFF-001"
}
],
"connector_id": "1",
"country_code": "NL",
"currency": "EUR",
"end_date_time": "2024-01-15T11:30:00Z",
"evse_uid": "3256",
"id": "SESSION-001",
"kwh": 15.32,
"last_updated": "2024-01-15T11:30:00Z",
"location_id": "LOC-001",
"meter_id": "METER-001",
"party_id": "CPO",
"start_date_time": "2024-01-15T10:00:00Z",
"status": "COMPLETED",
"total_cost": {
"excl_vat": 3.064,
"incl_vat": 3.7074
}
}
}401 — unauthorized
application/json
Response example
{
"status_code": 2001,
"status_message": "Unauthorized",
"timestamp": "2025-01-01T00:00:00Z"
}404 — not found
application/json
Response example
{
"status_code": 2001,
"status_message": "Session not found",
"timestamp": "2025-01-01T00:00:00Z"
}422 — validation error
application/json
Schema: HTTPValidationError
| Field | Type | Required | Description |
|---|---|---|---|
detail | ValidationError[] | No | Detail |
Response example
{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string",
"input": {
"_type": "Input"
},
"ctx": {
"_type": "Context"
}
}
]
}Examples
Shell, Python, and TypeScript (set OCPI_TOKEN when auth is required).
curl -sS -X GET 'https://ocpi-api.gridos.co/ocpi/emsp/2.2.1/sessions/NL/ABC/SESSION1' \
-H "Authorization: Token $OCPI_TOKEN"