5.1 RESTful API Design
WIA-UNI-008 APIs follow RESTful principles with standard HTTP methods:
GET: Retrieve routes, bookings, tracking dataPOST: Create new bookings, cargo shipments, vehiclesPUT: Update existing resourcesDELETE: Cancel bookings, deregister vehicles
5.2 Authentication and Security
OAuth 2.0 token-based authentication with scopes for granular access control:
routes:read/routes:writebookings:read/bookings:writetracking:readcargo:read/cargo:write
5.3 Key API Endpoints
Routes API
GET /v1/routes- List routes with filteringGET /v1/routes/{id}- Get route detailsPOST /v1/routes- Create new route
Bookings API
GET /v1/bookings/availability- Search availabilityPOST /v1/bookings- Create bookingGET /v1/bookings/{id}- Get booking detailsDELETE /v1/bookings/{id}- Cancel booking
Tracking API
GET /v1/tracking/vehicles/{id}- Real-time vehicle trackingGET /v1/tracking/bookings/{id}- Track passenger journeyWebSocket /v1/tracking/stream- Subscribe to live updates
5.4 Webhooks
Event-driven notifications for booking confirmations, cancellations, delays, and cargo status changes. Webhooks use HMAC-SHA256 signatures for security.
5.5 Rate Limiting
Fair usage policies: 1,000 req/hour (standard), 10,000 req/hour (premium), custom for enterprise.