📅 API

Advanced Schedule Management API with Resilient Caching

🔄 System Status

  • • Groups & Teachers & Classroom: Sync every 2 hours
  • • Student schedules: Cache every 5 mins
  • • Teacher schedules: Cache every 5 mins
  • • Classroom schedules: Cache every 5 mins

🛡️ Resilience Features

  • • Dual server instances for high availability
  • • Automatic fallback to cache when API is down
  • • Background data synchronization

👥 Student Groups

GET /api/v1/groups Resilient

Get list of all student groups with fallback to cache

✅ Returns cached data if external API is unavailable

GET /api/v1/groups/{groupId}

Get information about a specific group

Parameter: groupId - Group identifier (number)

👨‍🏫 Teachers

GET /api/v1/teachers Resilient

Get list of all teachers with fallback to cache

✅ Returns cached data if external API is unavailable

GET /api/v1/teachers/{teacherId}

Get information about a specific teacher

Parameter: teacherId - Teacher identifier (number)

🏢 Classrooms

GET /api/v1/classrooms

Get list of all available classrooms

📍 44 classrooms synchronized every 24 hours

📅 Schedules

GET /api/v1/groups/{groupId}/schedule Resilient Primary

🚀 Student Group Schedule - Get full semester schedule for group with automatic cache fallback

Most reliable endpoint with automatic cache fallback

GET /api/v1/teachers/{teacherId}/schedule Resilient Primary

🎓 Teacher Schedule - Get full semester schedule for teacher with automatic cache fallback

Covers entire semester with resilient data delivery

GET /api/v1/classrooms/{roomId}/schedule Primary

Get schedule for a specific classroom

Parameter: roomId - Classroom identifier (number)

🔄 Schedule Changes & Webhooks

GET /api/v1/groups/{groupId}/schedule/changes

Get schedule change history for a specific group - clean format without redundant fields

✅ Fixed: No redundant timestamp fields, includes hash for tracking

GET /api/v1/teachers/{teacherId}/schedule/changes

Get schedule change history for a specific teacher - proper routing fixed

✅ Fixed: Correct teacher ID parsing, proper name formatting

GET /api/v1/classrooms/{roomId}/schedule/changes

Get schedule change history for a specific classroom

Track room usage modifications and availability changes

🔗 Webhook Notification System

The system now supports webhook notifications for schedule changes. When changes are detected, the system sends simple JSON notifications to registered webhooks.

Webhook Payload Format:

{ "type": "groups|teachers|classrooms", "id": 123 }

Implementation Guide:

  • • Receive webhook notification
  • • Parse type and id from JSON
  • • Make GET request to: /api/v1/{type}/{id}/schedule/changes
  • • Process the change data

Note: Webhooks are "fire and forget" - the system sends notifications but doesn't retry on failures. Configure webhook URLs via admin endpoints.

💡 Usage Examples

🚀 Basic Data Retrieval

Get all groups:

curl /api/v1/groups

Get all teachers:

curl /api/v1/teachers

Get all classrooms:

curl /api/v1/classrooms

📅 Schedule Retrieval

Group 69 (Рт-279) schedule - entire semester:

curl /api/v1/groups/69/schedule

Teacher schedule (ID: 123):

curl /api/v1/teachers/123/schedule

Classroom 101 schedule:

curl /api/v1/classrooms/101/schedule

🔄 Change History

Group schedule changes:

curl /api/v1/groups/69/schedule/changes

Teacher schedule changes:

curl /api/v1/teachers/123/schedule/changes

Classroom schedule changes:

curl /api/v1/classrooms/101/schedule/changes

✨ System Features

🚀

High Availability

Dual server instances for 99.9% uptime

🛡️

Fault Tolerance

Automatic cache fallback system

🔄

Real-time Sync

Background data synchronization

Fast Response

Cached data served in milliseconds

🏢

Complete Coverage

All groups, teachers, and classrooms

📊

Change Tracking

Complete schedule modification history

Copied to clipboard!