Introduction
The Extracurricular Management System (EMS) API is a RESTful API built with Spring Boot that provides comprehensive functionality for managing university extracurricular activities, events, and user interactions.Base URL
The API is accessible at the following base URL:/api. For production deployments, replace localhost:8080 with your server’s hostname and port.
The default server port is 8080, but this can be configured via the
server.port property in your application configuration.API Conventions
Naming Conventions
The EMS API follows specific naming patterns for consistency:camelCaseID Pattern
All entity identifiers use camelCase with an uppercase “ID” suffix:userID- User identifier (Long)eventID- Event identifier (Long)activityID- Activity identifier (Long)proposalID- Proposal identifier (Long)registrationID- Registration identifier (Long)
Temporal Data Handling
The API uses LocalDate and LocalTime for temporal data without timezone support:- Date fields: Stored as
LocalDate(e.g.,eventDate,startDate) - Time fields: Stored as
LocalTime(e.g.,startTime,endTime) - Timestamps: Stored as
LocalDateTime(e.g.,createdAt,timestamp)
The API assumes all temporal data is in the server’s local timezone. No timezone conversion is performed.
Response Format
All API endpoints return a standardized response wrapper using the genericResponse<T> class wrapped in Spring’s ResponseEntity.
Standard Response Structure
Response<T> object contains the following fields:
HTTP status code (e.g., 200, 201, 400, 404, 500)
Human-readable message describing the result
The response payload. Type varies by endpoint. May be null for operations that don’t return data.
Server timestamp when the response was generated (LocalDateTime format)
List of error messages (only present in error responses)
Success Response Example
Error Response Examples
The API uses theGlobalExceptionHandler to provide consistent error responses:
HTTP Status Codes
The API uses standard HTTP status codes:| Status Code | Meaning | Usage |
|---|---|---|
| 200 | OK | Successful GET, PUT, or DELETE request |
| 201 | Created | Successful POST request that creates a resource |
| 400 | Bad Request | Invalid request data or business logic error |
| 401 | Unauthorized | Missing or invalid authentication token |
| 403 | Forbidden | Authenticated but lacking required permissions |
| 404 | Not Found | Resource does not exist |
| 500 | Internal Server Error | Unexpected server-side error |
Pagination
List endpoints support pagination using standard query parameters:Zero-based page number
Number of items per page
Optional search query to filter results
Paginated Response Example
Content Type
All requests and responses use JSON format:CORS
The API supports Cross-Origin Resource Sharing (CORS). The default allowed origin is:cors.allowed-origins property in your application configuration.
Rate Limiting
Currently, the API does not implement rate limiting. This may be added in future versions.
API Versioning
The current API version is implicit in the/api prefix. Future versions may introduce version-specific endpoints (e.g., /api/v2).
Next Steps
Authentication
Learn how to authenticate with JWT tokens
Endpoints
Explore available API endpoints