iTruck Map API

Real-time truck tracking application API documentation

API Endpoints

Truck Endpoints

GET /api/trucks

Get all trucks

GET /api/trucks/:id

Get a specific truck by ID

POST /api/trucks

Create a new truck

PUT /api/trucks/:id

Update a truck

DELETE /api/trucks/:id

Delete a truck (soft delete)

POST /api/trucks/:id/location

Update truck location

GET /api/trucks/:id/history

Get truck location history

GET /api/trucks/search

Search trucks by query and status

User Endpoints

POST /api/users/register

Register a new user

POST /api/users/login

Login a user

GET /api/users/profile

Get user profile (requires authentication)

PUT /api/users/profile

Update user profile (requires authentication)

GET /api/users

Get all users (admin only)

DELETE /api/users/:id

Delete a user (admin only)