Skip to content

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/guardian

Authentication

Guardians authenticate using JWT tokens obtained through login.

Login

POST /api/public/guardian/auth/login

json
{
  "phone": "+639171234567",
  "password": "password123"
}

Response:

json
{
  "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:

json
{
  "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:

json
{
  "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:

json
{
  "date": "2024-01-15",
  "status": "IN_SCHOOL",
  "timeIn": "7:30 AM",
  "timeOut": null
}

Get Announcements

GET /api/public/guardian/announcements

Response:

json
{
  "announcements": [
    {
      "id": "ANN-001",
      "title": "School Holiday Notice",
      "content": "...",
      "date": "2024-01-14"
    }
  ]
}

Register Device for Push

POST /api/public/guardian/notifications/register

json
{
  "fcmToken": "device-fcm-token",
  "platform": "android"
}

Attendance Status

StatusMeaning
PRESENTAttended school
ABSENTDid not attend
LATEArrived after cutoff
EXCUSEDExcused absence

Error Codes

CodeMeaning
UNAUTHORIZEDInvalid/expired token
STUDENT_NOT_FOUNDInvalid student ID
NOT_LINKEDGuardian 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

💡 Note: Guardian API requires user authentication. App users must register through the Guardian App.

Released under the MIT License.