API Route Structure

The Next.js API will follow a RESTful approach with the following structure:

POST

/api/sms/receive

Handles incoming SMS messages and processes gas readings.

POST

/api/gas-readings

Creates or updates a gas reading.

PATCH

/api/gas-readings/:id/location

Updates the location of a gas reading when the client’s location changes.

PATCH

/api/sensors/:id/fill-level

Updates the sensor’s fill level based on new readings.

PATCH

/api/sensors/:id/status

Updates sensor status based on readings.

PATCH

/api/clients/:id/location

Updates a client’s location and propagates changes to related gas readings.

PATCH

/api/clients/:id/status

Updates client status based on gas readings.

PATCH

/api/sms/:id/link

Links an SMS message to the correct sensor and client.

PATCH

/api/sms/:id/status

Updates the SMS status when linked to a sensor and client.

PATCH

/api/system/update-timestamp

Ensures timestamp updates when records are modified.

Last updated