@@ -11,6 +11,12 @@ You should also check Cozy's official documentations for konnectors :
...
@@ -11,6 +11,12 @@ You should also check Cozy's official documentations for konnectors :
- API Url for Development : [https://agence-rec.eaudugrandlyon.com](https://agence-rec.eaudugrandlyon.com/)
- API Url for Development : [https://agence-rec.eaudugrandlyon.com](https://agence-rec.eaudugrandlyon.com/)
- API Url for Production : [https://agence.eaudugrandlyon.com/ws](https://agence.eaudugrandlyon.com/ws)
- API Url for Production : [https://agence.eaudugrandlyon.com/ws](https://agence.eaudugrandlyon.com/ws)
## 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
## Authentication
In order to authenticate to the EGL API we have to request the following route
In order to authenticate to the EGL API we have to request the following route
...
@@ -56,7 +62,7 @@ Once you've sent this request the API should answer with a code 100 if everythin
...
@@ -56,7 +62,7 @@ Once you've sent this request the API should answer with a code 100 if everythin
## Fetch Data
## Fetch Data
:::warning
:::warning
The earliest data that can be fetched is November 2022 (not 3 years) due to migration from EGL to EPGL
The earliest data that can be fetched is November 2022 (not 3 years) due to migration from EGL to EPGL
:::
:::
...
@@ -118,12 +124,9 @@ If you're looking for more information about the API, checkout the [complete API
...
@@ -118,12 +124,9 @@ If you're looking for more information about the API, checkout the [complete API
| format | Format data for DB storage and remove bad data (former "T" typeagregats remain in response even if the data was added later, leading to duplicated data)|
| storeData | Save data in the right doctype db and prevent duplicated keys |
| format | Format data for DB storage and remove bad data (former "T" typeagregats remain in response even if the data was added later, leading to duplicated data) |
| resetInProgressAggregatedData | Function handling special case.The temporary aggregated data need to be remove in order for the most recent one to be saved. Ex for com.grandlyon.egl.year : `{ load: 76.712, year: 2020, ... }` need to be replace by `{ load: 82.212, year: 2020, ... }` after egl data reprocess |