API Documentation

Explore and test the available API endpoints for the waste management system

Back to Home

Endpoints

Available API endpoints

Waste Bins

Manage waste bins and their data

Backend API Documentation.

GET/api/v1/waste-bins/map

Generate and return a map of waste bin locations

Responses

StatusDescription
200HTML content with interactive map
422Validation Error
GET/api/v1/waste-bins

Get all waste bins with optional filtering

Parameters

NameTypeRequiredDescription
waste_typestringNoFilter by waste type
requires_maintenancebooleanNoFilter by maintenance status
min_fill_levelintegerNoMinimum fill level (0-100)
max_fill_levelintegerNoMaximum fill level (0-100)
areastringNoFilter by area
skipintegerNoNumber of records to skip
limitintegerNoMaximum records to return

Responses

StatusDescription
200List of waste bins
422Validation Error
GET/api/v1/waste-bins/{bin_id}

Get a specific waste bin by ID

Parameters

NameTypeRequiredDescription
bin_idstringYesBin ID

Responses

StatusDescription
200Waste bin details
404Waste bin not found
422Validation Error
PUT/api/v1/waste-bins/{bin_id}

Update a waste bin's information

Parameters

NameTypeRequiredDescription
bin_idstringYesBin ID
location_latnumberNoLatitude coordinate
location_longnumberNoLongitude coordinate
capacityintegerNoBin capacity
waste_typestringNoType of waste
current_fill_levelintegerNoCurrent fill level (0-100)
requires_maintenancebooleanNoMaintenance status
last_collectionstringNoLast collection timestamp

Responses

StatusDescription
200Updated waste bin details
404Waste bin not found
422Validation Error
DELETE/api/v1/waste-bins/{bin_id}

Delete a waste bin from the system

Parameters

NameTypeRequiredDescription
bin_idstringYesBin ID

Responses

StatusDescription
200Waste bin deleted successfully
404Waste bin not found
422Validation Error
POST/api/v1/waste-bins/create

Create a new waste bin

Parameters

NameTypeRequiredDescription
location_latnumberYesLatitude coordinate
location_longnumberYesLongitude coordinate
capacityintegerYesBin capacity
waste_typestringYesType of waste
current_fill_levelintegerYesCurrent fill level (0-100)
requires_maintenancebooleanYesMaintenance status

Responses

StatusDescription
201Waste bin created successfully
422Validation Error
POST/api/v1/waste-bins/{bin_id}/maintenance

Request maintenance for a waste bin

Parameters

NameTypeRequiredDescription
bin_idstringYesBin ID

Responses

StatusDescription
200Maintenance requested successfully
404Waste bin not found
422Validation Error
POST/api/v1/waste-bins/{bin_id}/collect

Mark a waste bin as collected and reset its fill level

Parameters

NameTypeRequiredDescription
bin_idstringYesBin ID

Responses

StatusDescription
200Waste collected successfully
404Waste bin not found
422Validation Error
GET/api/v1/waste-bins/stats/overview

Get overview statistics of all waste bins

Responses

StatusDescription
200Waste bin statistics
422Validation Error