Iternio APIs
EV Planning API
The Iternio EV route planner is built around the same route optimizer which powers the well-known and highly trusted ABetterRoutePlanner app. As ABRP is developed, the same features also become available in the route planning API; new car models, weather features, charger database updates, and so on.
To be able to use the API, you will need to obtain an API key. The pricing is simple: There is a small setup cost for new customers and thereafter we charge per successful plan delivered by the API, that is specifically the plan endpoint documented below. All other calls are free of charge.
The API is a standard REST API with HTTP parameters and JSON output. The API is versioned, and the present version is 1. When we introduce non-backward compatible changes, we will bump the API version and run the versions in parallel as long as it is possible.
Contact us at contact@iternio.com to discuss your need and obtain an API key.
Telemetry API
The Iternio Telemetry API allows your application to send data to A Better Routeplanner for use in driving with live data and helps us improve our car modeling.
To be able to use the API, you will need to obtain an API key and a user token for each user. The Telemetry-Only API keys are free and get you basic access to the Telemetry API. Contact us at contact@iternio.com to receive a Telemetry API key. The API key identifies your application to our server for authentication.
There are two ways of retrieving a user token for each telemetry, which is needed to identify the user (and vehicle) to the server so we can deliver the telemetry to them. The preferred method is via OAuth2 (See OAuth2 API), which will return a user token without any data entry. It’s also acceptable to have the user retrieve a token from our Live Data Setup screen.
ABetterRouteplanner.com deep links
The ABRP app in iOS/Android on the web can be started by linking users to the standard URL https://abetterrouteplanner.com . In addition, there are a set of URL deep linking parameters to allow you to configure ABRP in various ways so that the user gets a pre-selected plan or car model or similar. The set of deep links will be extended if there is interest for more.
ABRP OAuth2 API
OAuth2 provides a means of authenticating users easily and providing a secure and convenient way to identify and authenticate the user with Iternio. To set up OAuth2 with Iternio you will need an API key, and to provide us with a redirect URL and Application name. To get set up, send us an email at contact@iternio.com
Authorization Call
The first call made returns an HTML page on which the user can log in and approve the use of your application. If this HTML page is opened in the user’s default browser, their login may be cached and simplifies the process further.
The allowed scopes are:
-
get_telemetry: Allows your app to retrieve the user’s latest telemetry using the Telemetry API get_telemetry endpoint
-
set_telemetry: Allows your app to push new telemetry updates to the vehicle selected by the user using the Telemetry API send endpoint
-
get_plan: Allows your app to get the latest plan in condensed form from the user. Contact us for details.
-
vehicle_history: Allows your app to retrieve historic drives and charging sessions stored for the vehicle. Contact us for details.
Once the user approves the request you will receive the following at your redirect URI:
https://your_redirect_uri?state=<state_provided>&auth_code=<returned_auth_code>
Token Retrieval Call
Once you have received an authorization code from the user, you can then retrieve the token. This token can be stored and reused as many times as needed. The following fields are needed to retrieve the user’s token:
This call returns a JSON object with the following form:
{
"access_token": "<the created token>",
"token_type": "bearer",
"state": "<your supplied state>"
}
And that's it! From here you can include the user’s token on calls to the various services we provide that need to identify or authenticate a user.
User Info Retrieval Call
After you have obtained the token for the user, you are all set in terms of authentication. Now, to retrieve user information, use the “me” endpoint with the token:
https://api.iternio.com/1/oauth/me?access_token=<the user token>&api_key=<your api key
The default output of the call is a JSON object of the following form:
{
"user_id": <the numeric ID of the user>,
"full_name": "<Full name of the user>",
"email": "<Email of user>",
"vehicle_id": <The numeric ID of the vehicle, if part of the scope>,
"vehicle_name": "<The vehicle name>",
"vehicle_typecode": "<The vehicle typecode>"
}