ANTE User Manual

School Gate API

The School Gate API is the set of endpoints the Gate App (the tablet/kiosk at the school gate) uses to validate its license, download the student and guardian lists, and record attendance when a QR code is scanned.

Overview

Each physical gate runs the Gate App, which signs in with a license key issued for that gate. Once validated, the app:

  • Downloads the active students and guardians for the school (for offline scanning).
  • Records a check-in or check-out every time a person's QR code is scanned.
  • Shows today's attendance, who is currently checked in, and daily totals.

The system automatically decides whether a scan is a check-in or a check-out based on the person's most recent record that day — the operator does not choose.

Base URL

All endpoints live under the school-gate path on the school's ANTE server:

<your-ante-server>/api/public/school-gate

The exact server address is configured into the Gate App when it is installed, so operators never type it manually.

Authentication

Every request is authenticated with the gate's license key, sent in the request header. There is no username/password login — the license key is the credential.

Headers

x-license-key: YOUR_GATE_LICENSE_KEY
      Content-Type: application/json

📌 Note: The license key is provided by your system administrator and is tied to a single gate. Sign-in stores it on the device; the operator does not re-enter it for each scan.

Endpoints

Validate License (Sign In)

POST /api/public/school-gate/validate

Confirms the gate's license key and returns the gate's identity. The Gate App calls this when it signs in.

Request Body:

{
        "deviceInfo": {
          "deviceName": "Front Gate Tablet",
          "userAgent": "..."
        }
      }

Response (data):

FieldDescription
licenseIdThe license record's ID
gateIdThe gate this license belongs to
gateNameDisplay name of the gate (e.g. "Main Gate")
companyIdThe school the gate belongs to
isActiveWhether the license is active

Record a Scan (Check In / Check Out)

POST /api/public/school-gate/scan

Records attendance from a scanned QR code. The system decides automatically whether this is a check-in or a check-out.

Request Body:

{
        "qrCode": "student:UUID",
        "timestamp": "2024-01-15T07:30:00.000Z",
        "photo": null
      }

The qrCode value is prefixed with the person type — student:<id> or guardian:<id>.

Response (data): the recorded attendance entry, including id, qrCode, personId, personType (student or guardian), personName, profilePhoto, action (check_in or check_out), timestamp, deviceId, and companyId.

Sync Students

POST /api/public/school-gate/students

Downloads the active students so the gate can scan and identify them, including while offline.

Request Body:

{
        "limit": 10000,
        "offset": 0
      }

Response (data): a list of students. Each student includes id, studentNumber, firstName, lastName, middleName, dateOfBirth, gender, lrn, isActive, profilePhotoUrl, and the section (which carries the section name, adviser, school year, capacity, and the gradeLevel: code, name, and education level).

Sync Guardians

POST /api/public/school-gate/guardians

Downloads the active guardians so the gate can scan and identify them.

Request Body:

{
        "limit": 10000,
        "offset": 0
      }

Response (data): a list of guardians, each with id, firstName, lastName, contactNumber, and email.

Today's Attendance

GET /api/public/school-gate/attendance/today

Returns the attendance records recorded today. Each record carries id, qrCode, personId, personType, personName, profilePhoto, action, timestamp, deviceId, and companyId.

Currently Checked In

GET /api/public/school-gate/attendance/checked-in

Returns the people currently inside (checked in but not yet checked out). The response data includes a count and a people list; each person carries personId, personType, personName, checkInDateTime, deviceId, and location.

Attendance Statistics

GET /api/public/school-gate/attendance/stats

Returns today's totals: totalRecords, totalCheckIns, and totalCheckOuts.

Response Format

Every endpoint returns the same envelope:

{
        "success": true,
        "data": { },
        "message": "...",
        "timestamp": "2024-01-15T07:30:00.000Z"
      }

On failure, success is false and message describes the problem.

Actions

ActionMeaning
check_inThe person entered (scanned in)
check_outThe person exited (scanned out)

Duplicate Scan Protection

The Gate App will not record the same person twice within 10 seconds. A repeat scan inside that window is rejected with a message asking the operator to wait before scanning the same person again. This prevents accidental double scans.

Offline Behavior

The Gate App caches the synced student and guardian lists on the device. If the connection drops, scanning still works against the cached lists, and attendance queries fall back to the cached data so the gate keeps operating.

Tips

  • Sign in once — the license key is stored on the device after the first validation.
  • Sync before the day starts — run a student/guardian sync so the latest people and photos are on the device.
  • Keep the device time accurate — the scan timestamp comes from the device.

💡 Note: Contact your system administrator to obtain a gate license key.