Skip to main content

Student List API

How to read students, their classes and their related contacts from the API — the address comes back as separate fields as well as one combined string.

Written by Abdullah Al-Hussein

Overview

Read-only JSON endpoint that returns the students in your school with their classes, custom fields and related contacts — the same records as the student list in the app.

Authentication

Authenticate with the school's API key. Pass it either way:

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

The key identifies the school. Responses are automatically scoped to that school; there is no school_id parameter. We recommend the header form: keys passed in a URL can end up in server or proxy logs.

See Getting and using your API key if you don't have a key yet.

Endpoint

POST /api/v1/student

The older path /globalApis/student_list still works and returns the same response.

Parameters go in the request body, not the query string. Only the API key can be passed as a query parameter.

Parameters

Param

Type

Notes

id

integer

One student id. Omit → all students.

active

integer

1 → active only. 0 → inactive only. Omit → both.

search

string

Matches name, identification number, gender, email, phone, country or payment method.

per_page

integer

Records per page. Default 20.

page

integer

Page number. Default 1.

Archived students are never returned.

Example

curl -H "X-API-KEY: YOUR_KEY" -d "per_page=25&active=1" "https://app.teachngo.com/api/v1/student"

Response

{
"status": "success",
"totalRecords": 245,
"limit": 25,
"page": 1,
"totalPages": 10,
"next": 2,
"previous": null,
"data": [
{
"id": 12345,
"identification_number": "S-0042",
"fname": "Jane",
"lname": "Doe",
"email_address": "jane@example.com",
"street_name_and_number": "1 Example Street",
"area": "Example Area",
"city": "Example City",
"postcode": "A00 B1C2",
"country_code": "IE",
"whole_address": "1 Example Street, Example Area, Example City, A00 B1C2, Ireland",
"custom_fields": {"Year group": "Senior"},
"classes": [],
"related_contacts": [
{
"id": 67890,
"fname": "Mary",
"lname": "Doe",
"relationship": "guardian",
"email_address": "mary@example.com",
"mobile_phonecode": "353",
"mobile_phone": "871234567",
"subscribed_to_notifications": true
}
]
}
]
}

Field reference

The address is returned as separate components as well as one combined string, so you can report on any part of it.

Field

Meaning

id

The student's Teach 'n Go id

identification_number

Your own student reference, if your school uses them

street_name_and_number, flat_floor

Address lines

area

Area or district — this is where a county is usually recorded

city

Town or city

postcode

Postcode or Eircode

country_code

Two-letter country code, for example IE

whole_address

All of the above joined into one string

custom_fields

Your school's custom fields, keyed by field name

classes

The classes the student is enrolled in, with enrolment and unenrolment dates

related_contacts

The contacts linked to this student — see below

num_enrolled_courses

How many classes are in classes

Related contacts

Each student carries a related_contacts list. A student can have several, so this is always an array — empty if the student has none.

Field

Meaning

id

The related contact's Teach 'n Go id — stable, use it to match across calls

relationship

How they relate to the student, for example mother, father, guardian, payer

fname, lname

The contact's name

identification_number

Your own contact reference, if used

email_address, mobile_phone, home_phone

Contact details, with mobile_phonecode and home_phonecode holding the dialling codes

company

Company name, if recorded

whole_address

The contact's address as one string

general_notes

Free-text notes on the contact

subscribed_to_notifications

true if the contact receives notifications about this student

Tracking equipment or assets? Some schools create a student record per item, set a custom field such as Profile Type to Asset, and use the related contact to record who currently holds it. The related_contacts list is what tells you that.

Pagination and errors

The response wraps the records in totalRecords, limit, page, totalPages, next and previous. See API error codes and pagination.

Did this answer your question?