Guardian API Documentation
The Guardian API enables the Guardian mobile app to access student information, attendance data, and receive notifications.
Overview
Parents and guardians use the Guardian App to monitor their children's attendance and receive real-time notifications.
Base URL
https://your-domain.com/api/public/guardianAuthentication
Guardians authenticate using JWT tokens obtained through login.
Login
POST /api/public/guardian/auth/login
{
"phone": "+639171234567",
"password": "password123"
}Response:
{
"success": true,
"token": "eyJhbGc...",
"refreshToken": "eyJhbG...",
"user": {
"id": "GRD-001",
"name": "Maria Dela Cruz",
"students": [...]
}
}Endpoints
Get My Students
GET /api/public/guardian/students
Returns all students linked to the guardian.
Response:
{
"students": [
{
"id": "STU-001",
"name": "Juan Dela Cruz",
"grade": "Grade 6",
"section": "Section A",
"photo": "https://..."
}
]
}Get Student Attendance
GET /api/public/guardian/students/{studentId}/attendance
Query Parameters:
from- Start date (YYYY-MM-DD)to- End date (YYYY-MM-DD)
Response:
{
"attendance": [
{
"date": "2024-01-15",
"timeIn": "7:30 AM",
"timeOut": "4:30 PM",
"status": "PRESENT"
}
]
}Get Today's Status
GET /api/public/guardian/students/{studentId}/today
Response:
{
"date": "2024-01-15",
"status": "IN_SCHOOL",
"timeIn": "7:30 AM",
"timeOut": null
}Get Announcements
GET /api/public/guardian/announcements
Response:
{
"announcements": [
{
"id": "ANN-001",
"title": "School Holiday Notice",
"content": "...",
"date": "2024-01-14"
}
]
}Register Device for Push
POST /api/public/guardian/notifications/register
{
"fcmToken": "device-fcm-token",
"platform": "android"
}Attendance Status
| Status | Meaning |
|---|---|
| PRESENT | Attended school |
| ABSENT | Did not attend |
| LATE | Arrived after cutoff |
| EXCUSED | Excused absence |
Error Codes
| Code | Meaning |
|---|---|
| UNAUTHORIZED | Invalid/expired token |
| STUDENT_NOT_FOUND | Invalid student ID |
| NOT_LINKED | Guardian not linked to student |
Rate Limiting
- 60 requests per minute
- 429 response when exceeded
Tips
- Refresh Tokens - Use refresh tokens before expiry
- Cache Data - Reduce unnecessary API calls
- Handle Offline - Show cached data when offline
- Error Messages - Show user-friendly errors
Related Pages
- Push Notifications - Notification setup
- Guardian Management - Manage guardians
- Attendance Management - Attendance records
💡 Note: Guardian API requires user authentication. App users must register through the Guardian App.
