Once you've sent this request the API should answer with a code 100 if everything is ok and provides you a valid **token** and **num_abt** that you will use later in order to get data.
```json
{
"codeRetour":100,
"libelleRetour":"Connecté",
"resultatRetour":{
"num_abt":"toto",
"list_num_abt":["toto","tata"],
"token":"xxxxxxxxxxx"
}
}
```
## Fetch Data
In order to get data from the EGL API we have to request the following route :
| 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 |
Once you've sent this request the API should answer with a code 100 if everything is ok and provides you a valid **token** and **num_abt** that you will use later in order to get data.
```json
{
"codeRetour":100,
"libelleRetour":"Connecté",
"resultatRetour":{
"num_abt":"toto",
"list_num_abt":["toto","tata"],
"token":"xxxxxxxxxxx"
}
}
```
## Fetch Data
!!! warning "The earliest data that can be fetched is November 2022 (not 3 years) due to migration from EGL to EPGL"
In order to get data from the EGL API we have to request the following route :
| 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 |