API Reference
1. Fleet Management
GET /fleet/vehicles
Retrieves a list of all vehicles in the fleet.
Parameters: None specified
Response: List of vehicle objects (details to be specified)POST /fleet/task
Creates a new task for the fleet.
Parameters:
type (string): Type of task (e.g., "rebalancing")
details (object): Task details
vehicleId (integer): ID of the vehicle assigned to the task
Example request body:
{
"type": "rebalancing",
"details": { "from": "Station A", "to": "Station B" },
"vehicleId": 1
}
Response: Task creation confirmation (details to be specified)
GET /fleet/status
Retrieves the current status of the fleet.
Parameters: None specified
Response: Fleet status information (details to be specified)
2. Maintenance
POST /maintenance/task/customer
Creates a new maintenance task based on customer report.
Parameters:
vehicleId (integer): ID of the vehicle requiring maintenance
details (object): Details of the maintenance issue
Example request body:
{
"vehicleId": 1,
"details": { "issue": "Flat tire" }
}
Response: Maintenance task creation confirmation (details to be specified)
GET /maintenance/inactive-vehicles
Retrieves a list of inactive vehicles that may require maintenance.Parameters: None specifiedResponse: List of inactive vehicle objects (details to be specified)
3. Reporting
GET /reports/usage
Retrieves usage reports.
Parameters: None specified (might include date range parameters)
Response: Usage report data (details to be specified)
GET /reports/maintenance
Retrieves maintenance reports.
Parameters: None specified (might include date range parameters)
Response: Maintenance report data (details to be specified)
4. Trip Management
GET /trip/active
Retrieves a list of currently active trips.
Parameters: None specified
Response: List of active trip objects (details to be specified)
POST /trip/start
Initiates a new trip.
Parameters:
vehicleId (integer): ID of the vehicle being used for the trip
userId (integer): ID of the user starting the trip
Example request body:
{
"vehicleId": 1,
"userId": 1
}
Response: Trip initiation confirmation (details to be specified)
POST /trip/end
Ends an active trip.
Parameters:
tripId (integer): ID of the trip to end
Example request body:
{
"tripId": 1
}
Response: Trip end confirmation (details to be specified)
5. Vehicle Management
GET /vehicle/status
Retrieves the status of a specific vehicle.
Parameters:
vehicleId (integer): ID of the vehicle (likely passed as a query parameter)
Response: Vehicle status information (details to be specified)
POST /vehicle/update
Updates the status of a vehicle.
Parameters:
vehicleId (integer): ID of the vehicle to update
status (string): New status of the vehicle
Example request body:
{
"vehicleId": 1,
"status": "active"
}
Response: Vehicle update confirmation (details to be specified)