The attendance API allows you to record and retrieve student attendance for specific course offerings. Each attendance record captures whether a student was present, absent, late, or excused for a particular date.
Attendance Records
Attendance records track daily attendance for students in specific courses.
Create Attendance Record
ID of the course offering
ID of the teacher assignment who recorded the attendance
ID of the course enrollment
Date of the attendance (format: YYYY-MM-DD)
Attendance status: present, absent, late, or excused
Unique identifier for the attendance record
ID of the course offering
ID of the teacher assignment
ID of the course enrollment
Attendance status: present, absent, late, or excused
Timestamp when the attendance was recorded
curl -X POST "https://api.athena-erp.com/academic/attendance" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"course_offering_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"teacher_assignment_id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"course_enrollment_id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
"student_id": "d4e5f6a7-b8c9-4d0e-a1b2-c3d4e5f6a7b8",
"attendance_date": "2024-03-15",
"status": "present"
}'
{
"id": "e5f6a7b8-c9d0-4e1f-b2c3-d4e5f6a7b8c9",
"school_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"course_offering_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"teacher_assignment_id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"course_enrollment_id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
"student_id": "d4e5f6a7-b8c9-4d0e-a1b2-c3d4e5f6a7b8",
"attendance_date": "2024-03-15",
"status": "present",
"recorded_at": "2024-03-15T08:30:00Z"
}
List Attendance Records
Retrieve attendance records with optional filters for specific students or course offerings.
Filter by student ID to get all attendance records for a specific student
Filter by course offering ID to get attendance for a specific course
curl -X GET "https://api.athena-erp.com/academic/attendance?student_id=d4e5f6a7-b8c9-4d0e-a1b2-c3d4e5f6a7b8" \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"id": "e5f6a7b8-c9d0-4e1f-b2c3-d4e5f6a7b8c9",
"school_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"course_offering_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"teacher_assignment_id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"course_enrollment_id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
"student_id": "d4e5f6a7-b8c9-4d0e-a1b2-c3d4e5f6a7b8",
"attendance_date": "2024-03-15",
"status": "present",
"recorded_at": "2024-03-15T08:30:00Z"
},
{
"id": "f6a7b8c9-d0e1-4f2a-c3d4-e5f6a7b8c9d0",
"school_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"course_offering_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"teacher_assignment_id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"course_enrollment_id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
"student_id": "d4e5f6a7-b8c9-4d0e-a1b2-c3d4e5f6a7b8",
"attendance_date": "2024-03-14",
"status": "late",
"recorded_at": "2024-03-14T08:35:00Z"
},
{
"id": "a7b8c9d0-e1f2-4a3b-d4e5-f6a7b8c9d0e1",
"school_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"course_offering_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"teacher_assignment_id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"course_enrollment_id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
"student_id": "d4e5f6a7-b8c9-4d0e-a1b2-c3d4e5f6a7b8",
"attendance_date": "2024-03-13",
"status": "absent",
"recorded_at": "2024-03-13T08:30:00Z"
}
]
Attendance Status Types
The attendance system supports four status types:
Student attended the class on time
Student did not attend the class
Student arrived late to class
Student’s absence was excused (medical, family emergency, etc.)
Filtering by Course
To get attendance records for an entire course offering:
curl -X GET "https://api.athena-erp.com/academic/attendance?course_offering_id=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" \
-H "Authorization: Bearer YOUR_TOKEN"
This will return all attendance records for all students enrolled in that course offering, ordered by date (most recent first).
Use Cases
Daily Attendance Taking
Teachers can record attendance at the beginning of each class:
import requests
from datetime import date
# Record attendance for multiple students
students = [
{"student_id": "student-uuid-1", "status": "present"},
{"student_id": "student-uuid-2", "status": "late"},
{"student_id": "student-uuid-3", "status": "absent"},
]
for student in students:
response = requests.post(
"https://api.athena-erp.com/academic/attendance",
headers={"Authorization": "Bearer YOUR_TOKEN"},
json={
"course_offering_id": "course-uuid",
"teacher_assignment_id": "teacher-uuid",
"course_enrollment_id": f"enrollment-{student['student_id']}",
"student_id": student["student_id"],
"attendance_date": str(date.today()),
"status": student["status"]
}
)
print(f"Recorded {student['status']} for {student['student_id']}")
Attendance Reports
Generate attendance reports for specific students:
import requests
# Get all attendance for a student
response = requests.get(
"https://api.athena-erp.com/academic/attendance",
headers={"Authorization": "Bearer YOUR_TOKEN"},
params={"student_id": "student-uuid"}
)
attendance_records = response.json()
# Calculate statistics
total = len(attendance_records)
present = sum(1 for r in attendance_records if r["status"] == "present")
absent = sum(1 for r in attendance_records if r["status"] == "absent")
late = sum(1 for r in attendance_records if r["status"] == "late")
excused = sum(1 for r in attendance_records if r["status"] == "excused")
print(f"Total records: {total}")
print(f"Present: {present} ({present/total*100:.1f}%)")
print(f"Absent: {absent} ({absent/total*100:.1f}%)")
print(f"Late: {late} ({late/total*100:.1f}%)")
print(f"Excused: {excused} ({excused/total*100:.1f}%)")
Permissions
- Create attendance: Requires
write:attendance or write:all permission
- List attendance: Requires
read:attendance or read:all permission
Best Practices
- Record attendance daily: Consistent daily attendance tracking helps identify patterns early
- Use appropriate status: Choose the correct status type to maintain accurate records
- Automate when possible: Integrate with your school’s check-in systems to automate attendance recording
- Review regularly: Teachers and administrators should review attendance reports regularly to identify students who need support