AMPECO can send real-time information (notifications) to clients’ systems with data in JSON format. Filtering and processing the data happens in the clients' systems.
List with events
Here is a list with events for which your system can subscribe and receive notifications with data:
- BootNotification
- ChargePointChangedNotification
- ChargePointSyncConfigurationNotification
- CircuitConsumptionNotification
- circuit.changed
- DiagnosticsStatusNotification
- HardwareStatusNotification
- LocationChangedNotification
- NetworkStatusNotification
- SecurityEventNotification
- SessionMeterValuesNotification
- SessionStartStopNotification
- SessionUpdateNotification
- UserChangedNotification
- user.invoiceDetails.changed
- partner.changed
- authorization.changed
- SubOperatorChangedNotification
- TariffChangedNotification
- reservation.changed
- user.paymentMethod.changed
- partnerInvite.changed
- user.subscriptionChanged
- idTag.changed
- roamingPlatform.changed
- userBalance.changed
- transaction.changed
- settlementReport.created
- chargePoint.dataTransferReceived
- cdr.received
The full up-to-date list with events and the exact data they send can be found in the API documentation in Notifications / Subscribe.
AMPECO provides 2 ways to receive notifications: Kafka and webhooks.
Notifications via Kafka
In order to use Apache Kafka the following parameters needs to be configured either in the Notification section in the back office or with API Notifications / Subscribe.
- List of Kafka brokers
- Kafka topic
- Kafka security protocol
- Kafka SASL mechanism
- Kafka SASL username
- Kafka SASL password
Notifications via webhooks
A webhook delivers data to other applications as it happens, meaning you get data immediately. Unlike typical APIs where you would need to poll for updates very frequently to get it real-time, webhooks are designed to be triggered by specific events, sending an HTTP POST payload to the webhook's configured URL. This is very efficient for the client, as data is transmitted only when there's new information, reducing unnecessary network traffic and resource consumption.
How a webhook works:
-
A client subscribes to one or more events to receive notifications.
There are 2 ways to do it via:- graphical interface of the back office in the Notifications section
- API - Notifications / Subscribe
In both cases the following is specified:
- an URL that is a publicly accessible endpoint of the client’s system where to receive the webhook requests from the back office,
- one or more events/topics are selected which will trigger notifications and provide data.
-
An event is triggered.
An event occurs in the back office that triggers the webhook. The list with events is provided below. -
AMPECO sends an HTTP POST request with data payload.
When the event is triggered, AMPECO sends an HTTP POST request to the URL specified in the webhook configuration. The POST request includes a payload of data in JSON format relevant to the event that occurred. -
Client’s system handles the request.
The client’s system processes the incoming request, extracting and filtering the data payload and performing actions based on the received information. This could involve updating a database, triggering additional processes, sending notifications, or any other desired action.
Example: Receive meter values during charging session:
- Subscribe to SessionMeterValuesNotification either in the Notification section in the back office or with the API Notifications / Subscribe by providing an URL where to receive the notifications.
- Whenever there is a session AMPECO will send to the URL data in JSON format containing the following:
- notification
- chargePointId
- evseId
- sessionId
- externalSessionId
- meterValues[]
Validation if the notification is coming from AMPECO
The receiver of a webhook notification can validate if it comes from AMPECO. This can be done by computing a signature from the webhook payload and the API token used for that webhook in the back office as a cryptographic key using HMAC with SHA-256 algorithm.
Then the resulted signature is compared with the one sent by AMPECO in the notification as an HTTP header called X-Signature
.
They must be equal!