- API Url for Development : [https://prepro-epgl-ecolyo-efluidconnect.multield.net](https://prepro-epgl-ecolyo-efluidconnect.multield.net)
- API Url for Production : Not defined yet
## Update or create data
This konnector updates data if it has changed since the last execution or creates a new entry if the data is new. It also updates month and year aggregates except for start month and start year to prevent overriding data if user has more than 3 years of data.
For this we use a combinaison of the hydrateAndFilter function and the updateOrCreate function.
## Authentication
In order to authenticate to the EGL API we have to request the following route
Method : **POST**
Authentication Route : **/login**
```json
"body":
{
"user":"<epgl-user>",
"password":"<epgl-password>"
}
```
Once you've sent this request the API should answer with a code 200 and a token in the response header, under the variable name `EFLUIDCONNECT_TOKEN`.
## Identification
Using the `EFLUIDCONNECT_TOKEN` header, the path to identify the user is available
-`Status 200`: If the contract number does match the metering ID
-`Error 500`: If they do **not** match
## Fetch Data
:::warning
The earliest data that can be fetched is January 2024 due to the novelty of the API
:::
This path still requires `EFLUIDCONNECT_TOKEN` header
Method : **POST**
Data Route : **/contrats/consommationsJournalieres**
```json
"body":
{
"refContrat":"<contract-number>",
"refCompteur":"<metering-id>",
"dateDebut":"2023-12-31T22:00:00.000Z",
"dateFin":"2024-12-31T22:00:00.000Z"
}
```
The dates must be valid dates otherwise you'll get an error. They also should be in GMT-1.
The answer will provide you an array of data day by day with the value got by the water meter 'consommation'. The month value in the response data goes with values from 0 to 11. An example of the returned format with two days fetched can be found below:
This documentation details the technical implementation of the old konnector for EGL, using the Veolia API. A new version has been made based on the Efluid API, that planned to be released starting January 2025.
:::
[EGL repository, version v1.3.1](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/egl-konnector/-/tree/v1.3.1).
This konnector fetches consumption measures from EGL API.
The EGL API allows us to get a user's consumption data gathered by it's connected water meter "Téléo".