Skip to main content

Teacher Availability API

Read-only, pollable JSON endpoint that returns each active teacher's availability windows and recurring weekly time slots.

Written by Abdullah Al-Hussein

Overview

Read-only, pollable JSON endpoint that returns each active teacher's availability windows and the recurring weekly time slots within them.

Authentication

Authenticate with the school's API key (the same key the existing students_attendance endpoint uses). Pass it either way:

Header: X-API-KEY: <school_api_key>
Query:  ?apikey=<school_api_key>

The key identifies the school, so every response is automatically scoped to that school — there is no school_id parameter and no cross-school data leakage.

Endpoint

GET /globalApis/teacher_availability

There is no webhook/push — polling is the supported pattern (see below).

Parameters

Param

Type

Notes

teacher_id

string

One or comma-separated. Omit → all active teachers. Invalid → empty.

start_date

YYYY-MM-DD

Optional. Window-overlap filter (NULL-tolerant for open-ended windows).

end_date

YYYY-MM-DD

Optional.

modified_since

YYYY-MM-DD HH:MM:SS

Optional. Returns only teachers whose window or one of its slots changed since this time.

Examples

# Full pull
curl -H "X-API-KEY: YOUR_KEY" \
  "https://app.teachngo.com/globalApis/teacher_availability?teacher_id=678"# Incremental: reuse the previous response's meta.server_time
curl -H "X-API-KEY: YOUR_KEY" \
  "https://app.teachngo.com/globalApis/teacher_availability?modified_since=2026-06-26%2009:00:00"

Response

{
  "status": "success",
  "meta": { "server_time": "2026-06-26 10:15:03" },
  "data": [{
    "date_id": 55,
    "teacher_id": 678,
    "teacher_name": "John Smith",
    "start_date": "2026-06-01",
    "end_date": null,
    "created": "2026-06-01 08:00:00",
    "modified": "2026-06-20 11:30:00",
    "times": [{
      "id": 91,
      "day": "Monday",
      "day_no": 1,
      "start_time": "09:00",
      "end_time": "12:00",
      "modified": "2026-06-20 11:30:00"
    }]
  }]
}

Field Reference

Field

Meaning

date_id

Availability window id

teacher_id / teacher_name

The teacher

start_date / end_date

Window range (end_date: null = open-ended)

created / modified

Window audit timestamps

times[]

Recurring weekly slots in the window

times[].day / day_no

Weekday name and number (1 = Monday)

times[].start_time / end_time

Slot time (HH:MM)

Polling Pattern

  1. First call with no modified_since → store meta.server_time from the response.

  2. Next call pass modified_since=<that server_time> → only changed teachers come back.

Caveat: a hard-deleted slot is not detectable via modified_since alone. When a teacher appears in a delta response, re-fetch that teacher's full window to reconcile any removed slots.

Did this answer your question?