Enode API
Download [OpenAPI 3.0 Specification](/OpenAPI-Enode-v1.4.0.json) Download [Postman Collection](/Postman-Enode-v1.4.0.json) The Enode API is designed to make…
Maps & location#openapi#location
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Download OpenAPI 3.0 Specification
Download Postman Collection
The Enode API is designed to make smart charging applications easy to develop. We provide an abstraction layer that reduces the complexity when extracting vehicle data and sending commands to vehicles from a variety of manufacturers.
The API has a RESTful architecture and utilizes OAuth2 authorization.
We are always available to handle any issues or just answer your questions. Feel free to reach out on post@enode.io
Registration for API access
In order to use the API you will need a client_id and client_secret. Please contact us if you are interested in using our API in production, and we will provide these credentials.
Authorization
Vehicle / hardware access via the Enode API is granted to your application by the User in a standard OAuth Authorization Code flow.
> The authorization scheme documented here is the recommended approach for most situations. However, it is also possible to user other OAuth flows, non-confidential clients, and temporary users. Please feel free to contact us if you have any questions about your use-case or the integration of your existing infrastructure.
Preparation: Configure your OAuth client
Because Enode API implements the OAuth 2.0 spec completely and without modifications, you can avoid rolling your own OAuth client implementation and instead use a well-supported and battle-tested implementation. This is strongly recommended. Information on available OAuth clients for many languages is available here
To configure your chosen OAuth client, you will need these details:
- Your
client_id - Your
client_secret - Authorization URL:
https://link.test.enode.io/oauth2/auth - Token URL:
https://link.test.enode.io/oauth2/token
// Node.js + openid-client example
const enodeIssuer = await Issuer.discover('https://link.test.enode.io');
const client = new enodeIssuer.Client({
client_id: 'xyz',
client_secret: 'shhhhh',
redirect_uris: ['http://localhost:5000/callback'],
response_types: ['code'],
});Preparation: Obtain a client access token via OAuth Client Credentials Grant
Your OAuth client will have a method for using the OAuth 2.0 Client Credentials Grant to obtain an access token.
// Node.js + openid-client example
const clientAccessToken = await client.grant({grant_type: "client_credentials"});This access token belongs to your client and is used for administrative actions, such as the next step.
This token should be cached by your server and reused until it expires, at which point your server should request a new one.
Step 1. Generate an Enode Link session for your User and launch the OAuth flow
When your User indicates that they want to connect their hardware to your app, your server must call Link User to generate an Enode Link session for your User. The User ID can be any string that uniquely identifies the User, but it is recommended that you use the primary key by which you identify the User within your application.
Example Request:
POST /users/{userId}/link HTTP/1.1
Authorization: Bearer {access_token}
{
"forceLanguage": "nb-NO",
"vendor": "Tesla",
}Example Response:
{
"linkState": "ZjE2MzMxMGFiYmU4MzcxOTU1ZmRjMTU5NGU2ZmE4YTU3NjViMzIwY2YzNG",
}The returned linkState must be stored by your server, attached to the session of the authenticated user for which it was generated.
Your OAuth client will provide a method to construct an authorization URL for your user. That method will require these details:
- Redirect URI - The URI to which your user should be redirected when the Oauth flow completes
- Scope - The OAuth scope(s) you wish to request access to (see list of valid values here)
- State - The value of
linkStatefrom the request above
To launch the OAuth flow, send your user to the authorization URL constructed by your OAuth client. This can be done in an embedded webview within a native iOS/Android app, or in the system's default browser.
// Node.js + openid-client + express example
// Construct an OAuth authorization URL
const authorizationUrl = client.authorizationUrl({
scope: "offline_access all",
state: linkState
});
// Redirect user to authorization URL
res.redirect(authorizationUrl);Step 2. User grants consent
In the Link UI webapp the user will follow 3 steps:
- Choose their hardware from a list of supported manufacturers (EVs and charging boxes). For certain EV makes it will be necessary to also select a charge box.
- For each selection, the user will be presented with the login screen for that particular hardware. The user must successfully log in.
- A summary of the requested scopes will be presented to the user. The user must choose whether to grant access to your…
Endpoints 28
Charging Locations
- GETList Charging Locations
/charging-locationsReturns a list of Charging Locations registered to the User - POSTCreate Charging Location
/charging-locations - GETGet Charging Location
/charging-locations/:chargingLocationId - PUTUpdate Charging Location
/charging-locations/:chargingLocationIdUpdates a charging location with new configuration - DELETEDelete Charging Location
/charging-locations/:chargingLocationIdDelete a Charging Location
Me
- GETGet My User
/meReturns metadata about the authenticated User, including a list of vendors for which the user has provided credentials. - DELETEDisconnect Vendor
/me/vendors/:vendorDisconnect a single Vendor from the User's account. All stored data about their Vendor account will be deleted, and any vehicles that were provided by that…
Chargers
- GETList Chargers
/chargers?field[]=chargeState - GETGet Charger
/chargers/:chargerId?field[]=chargeState - POSTControl Charging
/chargers/:chargerId/chargingInstruct the charger to start or stop charging
Service Health
- GETCheck Service Readiness
/health/readyGets the combined health status of the service and all functionalities and dependencies. - GETCheck Available Vendors
/health/vendorsList the supported vendors and their current status.
Statistics
- GETGet User Charging Statistics
/statistics/charging?resolution=DAY&startDate=2024-01-01&endDate=2024-01-01&vehicleId=string&chargingLocationId=stringReturns a normalized timeseries of statistics about power consumption and price for the User.
User Management
- DELETEUnlink User
/users/:userIdDeletes a User and all of their data permanently, and invalidates any associated sessions, authorization codes, and access/refresh tokens - DELETEDeauthorize User
/users/:userId/authorizationDeletes the User's stored vendor authorizations and credentials, invalidates any associated sessions, authorization codes, and access/refresh tokens. All… - POSTLink User
/users/:userId/linkCreates an Enode Link session attached to the provided User ID. If this User does not exist, it will be created. The returned linkState gives the user…
Vehicles
- GETList Vehicles
/vehicles?field[]= - GETGet Vehicle
/vehicles/:vehicleId?field[]=smartChargingPolicy - GETGet Vehicle Charge State
/vehicles/:vehicleId/charge-state - POSTStart / Stop Charging
/vehicles/:vehicleId/chargingInstruct the vehicle to start or stop charging. Precedence over smart charging If the vehicle is at a charging location where smart charging is activated: a… - GETGet Vehicle Information
/vehicles/:vehicleId/information - GETGet Vehicle Location
/vehicles/:vehicleId/location - GETGet Vehicle Odometer
/vehicles/:vehicleId/odometer - GETGet Vehicle Smart Charging Policy
/vehicles/:vehicleId/smart-charging-policy - PUTUpdate Vehicle Smart Charging Policy
/vehicles/:vehicleId/smart-charging-policyUpdates the Smart Charging settings for a vehicle - POSTStart Watching Vehicle
/vehicles/:vehicleId/watchTemporarily triggers high-rate updates of the vehicle's properties, and this state expires automatically. This gives you a way to tell us that user may be…
Webhooks 🧪
- PUTUpdate Firehose Webhook
/webhooks/firehose - POSTTest Firehose Webhook
/webhooks/firehose/testTrigger a test payload to be sent to your configured Firehose Webhook url.
API details
- Base URL
https://api.test.enode.io- Authentication
- OAuth 2.0 (client credentials flow)
OAuth 2.0 (authorization code flow) with 11 scopes - Operations
- 28 operations on 24 pathsGET 15POST 6DELETE 4PUT 3
- Main resources
- Vehicles 10Charging Locations 5Chargers 3User Management 3Me 2Service Health 2Webhooks 🧪 2Statistics 1
- Response formats
application/json- Description format
- OpenAPI 3.0.0, API version
1.3.10 - Links
- OpenAPI document
- Listed from
- APIs.guru OpenAPI Directory (CC0-1.0)
Source updated
How to test the Enode API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Enode API collection, without the publisher's secrets.
- Add your credentialsThis API uses OAuth 2.0 (client credentials flow). Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “List Charging Locations” (GET /charging-locations), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Enode API?
Download [OpenAPI 3.0 Specification](/OpenAPI-Enode-v1.4.0.json) Download [Postman Collection](/Postman-Enode-v1.4.0.json) The Enode API is designed to make… It is listed under Maps & location and has 28 endpoints.
Who publishes the Enode API?
It is listed from Enode's public API description (an OpenAPI document), not published by Enode on Swastik Codes. Anyone who controls enode.io can claim the profile by adding a DNS TXT record.
What is the base URL of the Enode API?
Requests go to https://api.test.enode.io. Endpoint paths are added to this base URL.
How do I authenticate with the Enode API?
It accepts 2 methods: OAuth 2.0 (client credentials flow); OAuth 2.0 (authorization code flow) with 11 scopes.
How many endpoints does the Enode API have?
28 operations on 24 paths (15 GET, 6 POST, 4 DELETE, 3 PUT). The largest groups are Vehicles, Charging Locations, Chargers, User Management.
Is forking the Enode API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.