1. API Purpose
The Noticeboard API serves as the school’s official broadcast channel. It provides a permanent and searchable record of formal announcements, replacing physical notice boards.2. Endpoint Definition
| Method | Route | Auth | Description |
|---|---|---|---|
| GET | /parent-app/noticeboard | 🔐 JWT | View official school notices |
| GET | /teachers-app/noticeboard | 🔐 JWT | View official school notices |
| GET | /web-app/noticeboard | 🔐 JWT | Admin: View school-wide notices |
| POST | /web-app/noticeboard | 🔐 JWT | Admin: Create a new formal notice |
| PUT | /web-app/noticeboard/:id | 🔐 JWT | Admin: Update notice content |
| DELETE | /web-app/noticeboard/:id | 🔐 JWT | Admin: Soft-delete a notice |
3. Authentication Flow
Standard JWT validation. All parents and staff within the same school (skole_id) see the same global noticeboard feed.
4. Request Structure
GET /parent-app/noticeboard
Headers:GET /teachers-app/noticeboard
Query Parameters:| Field | Type | Required | Description |
|---|---|---|---|
| skole_id | string | Yes | School identifier. |
| notice_type | string | No | Filter by type. |
GET /web-app/noticeboard
Query Parameters:| Field | Type | Required | Description |
|---|---|---|---|
| skole_id | string | Yes | School identifier. |
| page | number | No | Page number (Default: 1). |
| limit | number | No | Records per page (Default: 10). |
POST /web-app/noticeboard
Request Body:PUT /web-app/noticeboard/:id
Request Body:DELETE /web-app/noticeboard/:id
URL Parameters:| Field | Type | Description |
|---|---|---|
| id | number | ID of the notice to delete. |
5. Response Structure
Success: Parent Notice Feed (200 OK)
Route:GET /parent-app/noticeboard
Success: Teacher Notice Feed (200 OK)
Route:GET /teachers-app/noticeboard
Success: Admin Notice List (200 OK)
Route:GET /web-app/noticeboard
Success: Notice Created (201 Created)
Route:POST /web-app/noticeboard
Success: Notice Updated (200 OK)
Route:PUT /web-app/noticeboard/:id
Success: Notice Deleted (200 OK)
Route:DELETE /web-app/noticeboard/:id
6. Error Responses
| HTTP Code | Description |
|---|---|
| 404 | Notice not found |
| 400 | Missing notice_title in creation |
7. Security Considerations
- Integrity: Only users with
noticeboard.createstaff permissions can broadcast notices. - Soft Delete:
notice_deleted = 1removes the notice from public view while preserving audit logs.
8. Token Usage
9. Token Refresh
N/A.10. Logout / Session Invalidation
N/A.11. Usage Example (cURL)
12. Notes / Special Behaviors
- Typing: Notice types determine the color-coding in the mobile app (e.g., Blue for
exam, Orange forfee). - Persistence: Unlike Activities, notices are generally long-lived and pinned to the top of the feed if marked as high importance.