End Points
End Points
Route :
Distance : from summary end point
address : matqishach
pilote rah mqad : from drivers endpoint but you have to add the deviceId to fetch the driver
for that deviceId
Odometer : api/positions endpoint
fuel level : "fuelLevelPercentage" from positions endpoint
Consumption : from summary end point "fuelSpent" hado li "" rah attributes f response.
Temp de contuite :
Driving time : "engineHours" fiha problem hoa khasha formate dialha sinon ay3tik raqm kbir ,
from summary end point , check "src/reports/suumaryReportPage.jsx" to understand the
logic .
-idle time is the total of time for that day the vehicule was idle and not moving . from
positions end point ; use this explanation to understand
Vitesse :
max speed and average speed from positions endpoint
overspeed is an event when the speed limmite was exceeded it s in
reports/eventreportpage.jsx u can find here the logic .
as for the endpoint /api/event/{id} because the device can be modied and add to it events
and based on those event you will get notifications ,you can use the endpoint to fetch when
the max speed was
http://localhost:3000/api/reports/events?deviceId=8&from=2024-10-
01T23%3A00%3A00.000Z&to=2024-10-02T22%3A59%3A59.999Z&type=deviceOverspeed
this is an example of a device that has the type deviceoverspeed i got it from inspect
element of reports/events path in the web , i don t think you will need this but u must
understand it .
http://localhost:3000/api/reports/trips?deviceId=3&from=2024-10-
01T23%3A00%3A00.000Z&to=2024-10-02T22%3A59%3A59.999Z
and this is the end point GET to get the actual number of over speed and the
tripreportspage.jsx or the logic on it will handle fetching the maximum speed the vehicules
reached
for temerature :
in api/positions ; there is 4 of them , one of them u can test with it it s in duster_temp devices
, point on this deviceId and you will get the temp i think it s in C°
if there is a zer ovalue display it , if there is null display no data .
for geofence entered ; i want to display the name of the geofence for example if you go to
http://localhost:3000/reports/event and chosed event type geofence entered and exited , and
columns ( type ) the type is either exite or enter , the column is the actual name of the
geozone , for example emsigeozone ..etc
http://localhost:3000/api/reports/events?deviceId=3&from=2024-09-
30T23%3A00%3A00.000Z&to=2024-10-
01T22%3A59%3A59.999Z&type=geofenceExit&type=geofenceEnter
this is from the inspect element for duster .
use the reports pages in the interface to get what you want and find the endpoint get
methode easily from the inspect element .