Skip to main content
API

Getting started with REST API

Authentication

API Testing endpoint is: https://api.emabler.net/api/

As an authentication method our API uses an both API key and Client ID, which are required in query parameters in every request.

Following keys are used in query parameters:

  • code = <your apikey>
  • clientId= <your client id>
Don't have API key or clientId?

Please contact our support to get access to APIs.

Example call

https://api.emabler.net/api/statistics?code=<apikey>&clientId=<customerId>
caution

Please note that only HTTPS calls are accepted!

API Documentation

Link to API Endpoint documentation

API Endpoint documentation has demo functionality built-in, so you can test the APIs directly from the documentation with you API and client keys.

tip

You may also download the OpenAPI description and use for example Postman for testing the API.
https://api.emabler.net/api/swagger.json

Starting points with a new account

Creating your first site

First we suggest you create a new site to the system.

POST /api/group/add

You give a parameter on the POST body for the name of the site:

{
"name": "New Site Name"
}

You get the newly created site ID as a reply (on the response body). This id is generated by us and it is an integer.

Creating a charger

After the site has been created, then you need to create a new charger.

POST /api/charger/add/:chargerId/:groupId

On the URL you need to give an ID for the new charger and the groupId that you received from creating the site previously.

caution

Charger ID needs to be globally unique. So we suggest you use some prefix on ID:s like <companyName>_actualID. For example we would create charger with ID: EMABLER_Charger12345

You give a parameter on the POST body for the charger name and other info. But the name is enough for this time.

{
"chargerName": "New Charger Name"
}

As a reply you get the freshly created chargerId as a 200 OK reply.

caution

Please take note that the chargerId should not contain special characters that could potentially break the URL functionality. Furthermore, the groupId also undergoes a validation process. Therefore, if you receive an error response, it is likely due to an incorrect charger ID or groupId.

Connecting a charger

Now you have a charger created on the system. The only thing left is to actually configure the charger to connect to the system.

info

Our testing endpoint for chargers with OCPP1.6/JSON is:
wss://ocpp16.emabler.net/ocpp/

If you specify this url as the OCPP endpoint on your charger and the the same chargerID that you just specified you get the unit connected on our platform.

Checking the status

You can use the API to check the status of the charger connection.

GET /api/charger/:chargerId

You provide the same chargerId as when creating the charger.

Example response:

{
"chargerId": "string",
"chargerName": "string",
"firmwareVersion": "string",
"manufacturer": "string",
"serialNumber": "string",
"chargerModel": "string",
"amountOfSockets": 0,
"lastSeen": "2021-07-01T11:53:42.429Z",
"lastMessage": "string",
"activeConnection": true,
"locationInfo": {
"latitude": 0,
"longitude": 0,
"streetAddress": "string",
"streetNumber": "string",
"houseLetter": "string",
"postalNumber": "string",
"city": "string",
"area": "string",
"country": "string"
},
"pushIntegrationEnabled": true,
"chargerSpecificMessageStructure": true,
"chargerConfigurations": [
{
"configName": "string",
"configValue": "string",
"canBeChanged": true
}
],
"sockets": [
{
"type": "string",
"maxPower": "string",
"status": "string",
"id": 0
}
]
}
note

If the charger has not yet connected to the system, for example socket information is empty. It might take a few minutes for the charger to send all the info about it self.

The most interesting fields when checking charger connection are:

  "lastSeen": "2021-07-01T11:53:42.429Z",
"lastMessage": "string",
"activeConnection": true,

lastSeen is time stamp when we got lastMessage. Note that all of our timeStamps are in UTC.
lastMessage is the last RAW OCPP message we got from the charger.
activeConnection tells you if we have websocket connection open to the charger.

🎉Now you are free to explore!

You have everything needed set up and you are ready to start your journey with eMabler platform! We appreciate any findings or suggestions to the API you might have and please don't hesitate to contact our support if needed.

Thanks from the eMabler Team! 👋