Welcome
API Manifesto
Our API is more than just endpoints and data - it’s a developer experience. This document outlines the principles, conventions, and policies we follow to ensure our APIs are usable, consistent, and future-proof.
📐 Structure & Versioning
- All endpoints support versioning based on header
- Default versioning is provided for backward compatibility
- Version format:
VYYYY_MM_DD(e.g.,V2024_01_18,V2024_07_01)
Code - Breaking changes only occur in explicit new versions
- New features are non-breaking and additive
▶️ Pagination and Data Access
-
Support for two pagination types:
- Offset-based pagination: This is used for simpler scenarios where you need to navigate through pages with a fixed number of items.
Codeii. Cursor-based pagination : This is used for large datasets and better performance. Instead of page numbers, it uses cursor values (usually IDs) to navigate through results.
-
Code
🧾 Naming Conventions
Endpoints
- Use plural nouns for resources:
Example:
Code
Models / Fields
- Single responses are returned directly at the root level without wrapping
- Multiple responses are always wrapped in a
dataarray (data: []) - The
dataproperty for multiple responses will always contain an array, never an object - Even when returning an empty result set, the structure maintains
data: [] - Use camelCase for JSON keys:
Example:
Code
Query Parameters
- Use camelCase for URL Parameters:
- Common parameters:
page: Page number (zero-based)perPage: Items per pagesearch: Search termsort: Sorting fieldorder: Sort order (asc/desc)filter*: Filter parameters- Temporal filters: ,
fromto
Example:
Code
🔐 Authentication
- Bearer token authentication required for all endpoints. Reference: token
- Token format:
Authorization: Bearer <token> - Token expiration and refresh mechanism
- Rate limiting per token
- Scope-based access control
- Failed authentication returns 401 Unauthorized
- Invalid permissions returns 403 Forbidden
Example:
Code
❗Error Handling
Error Response Structure
- Consistent error response structure:
Code
Error Codes
The API uses an enumerated set of error codes:
Authentication & Authorization
- Authentication failed
UNAUTHORIZED - Permission denied
ACCESS_FORBIDDEN - Invalid service credentials
INVALID_OR_MISSING_SERVICE_TOKEN - Invalid access token
INVALID_ACCESS_TOKEN - Invalid refresh token
INVALID_REFRESH_TOKEN
Resource Errors
- Requested resource doesn't exist
RESOURCE_NOT_FOUND - Consumer not found
CONSUMER_NOT_FOUND - Application not found
APPLICATION_NOT_FOUND - Consumer account is disabled
CONSUMER_DISABLED
Request Errors
- Invalid request parameters
BAD_REQUEST - Request validation failed
UNPROCESSABLE_ENTITY
System Errors
- Internal server error
INTERNAL_SERVER_ERROR - Upstream service error
BAD_GATEWAY
Domain-Specific Errors
- Unable to start charging
CHARGING_FAILED_TO_START - Chargepoint is offline
CHARGING_CHARGEPOINT_OFFLINE - Chargepoint unavailable
CHARGING_CHARGEPOINT_NOT_AVAILABLE - Restart charging failed
CHARGING_FAILED_TO_RESTART - Reservation not enabled
CHARGING_CHARGEPOINT_RESERVATION_NOT_ENABLED
HTTP Status Codes
| Status Code | Usage |
|---|---|
| 400 | Bad Request - Invalid input parameters |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 422 | Unprocessable Entity - Validation failed |
| 500 | Internal Server Error |
| 502 | Bad Gateway - Upstream service error |
✅ Response Structure
- Success responses
Code
- Collection responses
Code
📢 Deprecation Notice
Version Lifecycle
- Versions follow VYYYY_MM_DD format
- Minimum 6-month support for deprecated versions
- Three phase deprecation:
- Announcement
- Deprecation period (6 months)
- Sunset (version support removed)
Deprecation Notice
- Deprecation communicated via:
- Response headers:
X-API-Deprecated: true X-API-Sunset-Dateheader- Documentation updates
- Email notifications to API consumers
- Response headers:
Last modified on