All Collections
Integrations & APIs
New Student and Class Registration API
New Student and Class Registration API

Teach 'n Go API: Automatic Student Registration Guide

Abdullah Al-Hussein avatar
Written by Abdullah Al-Hussein
Updated over a week ago

You can automate the student registration process in Teach 'n Go using this API. Follow these steps to add and enrol students into classes seamlessly.


โ€‹

Authentication

An API key is required for authentication. Here's how to find yours:

  1. Go to the School Settings Page.

  2. Click on the Developers tab.

  3. Create an API Key.

The Student Registration API Request

2. Method: POST

3. Body: JSON

Use the API key either in the header (X-API-KEY: key value) or as a query parameter (apikey=keyvalue).

Example of the body:

{
"fname":"test",
"lname":"test",
"gender":"Male",
"registration_date":"2022-11-30",
"date_of_birth":"2022-11-30",
"identification_number":"1004",
"preferred_payment_method":"1",
"discount_percentage":"10",
"mobile_phone_code":"91",
"mobile_phone":"9429291772",
"home_phone_code":"0265",
"home_phone":"2521772",
"email_address":"test@test.com",
"street_name_and_number":"",
"flat_floor":"",
"area":"",
"city":"",
"postcode":"",
"country_code":"",
"general_notes":"",
"medical_notes":"",
// Add TnG IDs as array
"courses":[],
// Add TnG IDs as array
"events":[],
"custom_fields": {
// Text box example
"Nationality":"Indian",
// Check box example
"is Document submitted?":true,
// Drop down value for multiple and single selection example
"Mother tongue":["English","Hindi","Spanish"],
// Date box example
"Date":"2023-06-16"
},
"enrolment_date":"2022-11-30"
}

Important: When using this API, If the student email is already in use by a student in the school, no new student is created, and this existing student will be enrolled in the class.

API Response

Below are the possible responses to the request.

Success

{
"status": "success",
"message": "student inserted successfully",
"data": {
"id": "144515"
}
}

Validation Error

{
"status": "fail",
"message": "validation Error",
"errors": {
"fname": [
"Enter a first name"
]
}
}

401 Unauthorized

{
"status": "fail",
"message": "unauthorized user"
}

Variables List

Below are the variables and data types that could be used when sending a request.

Variable Name

Data Type

Possible value

fname *

Text

MANDATORY

lname *

Text

MANDATORY

gender

Text

Male | Female | Not specified

registration_date

Date (YYYY-MM-DD)

2022-11-30

date_of_birth

Date (YYYY-MM-DD)

2022-11-30

identification_number

Text

preferred_payment_method

Numeric

Cash = 1,

Cheque =2,

Credit Card = 3

Bank Transfer = 4

Direct Debit = 5

discount_percentage

Float

0-100

mobile_phone_code

Numeric

Length 2-4

mobile_phone

Numeric

home_phone_code

Numeric

Length 2-4

home_phone

Numeric

email_address

Text

Email Format email@email.com

street_name_and_number

Text

flat_floor

Text

area

Text

city

Text

postcode

Text

country_code

Text

ISO code 2 letter, e.g. (US, UK, IN)

general_notes

Text

medical_notes

Text

courses

Array

Course id [13,156]

enrolment_date

Date(YYYY-MM-dd)

date

Return the List of School Classes

Use the following API to get a list of active and scheduled classes in the school. You can use the obtained course ID to enrol students in courses.

2. Method: GET

Possible Response

Success

{
"status": "success",
"message": " course list retrieved",
"data": {
"1": {
"57651": "Booking Class with tarang teacher",
"57653": "Booking Class with tarang teacher"
},
"2": {
"57630": "booking class",
"57645": "class"
}
}
}

Data Glossary

1: Scheduled classes

2: Active classes

Did this answer your question?