Elsieapp Portal API Documentation
PRE-REQUESITE
URL PREFIX
Every request should be prefixed by https://{client_id}.elsieapp.com/api/.
{client_id} being the school prefix for elsieapp.
AUTHENTICATION HEADER
You will need an access token to authenticate.
The following HEADERS should always be present.
| Key | Value |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
| Authorization | Bearer {access_token} |
Data sources
Each request will return a list of product ids per product category. Some product category will have extended details associated with the product.
Accommodation types
REQUEST
GET /data-sources/accommodation-types
RESPONSE
{
"data": [
{
"product_id": 29,
"product_name": "Executive Homestay",
"description": "Executive Homestay description..."
},
{
"product_id": 59,
"product_name": "Homestay",
"description": "Homestay description..."
},
{
"product_id": 143,
"product_name": "Self-Catering Full Ensuite",
"description": "Self-Catering Full Ensuite description..."
},
{
"product_id": 90,
"product_name": "Self-catering Superior",
"description": "Self-catering Superior description..."
}
]
}
Airport transfers
REQUEST
GET /data-sources/airport-transfers
RESPONSE
{
"data": [
{
"product_id": 41,
"product_name": "Gatwick Airport"
},
{
"product_id": 40,
"product_name": "Heathrow Airport"
},
{
"product_id": 10,
"product_name": "London City Airport"
},
{
"product_id": 9,
"product_name": "Luton Airport"
},
{
"product_id": 8,
"product_name": "Stansted Airport"
}
]
}
Course details
REQUEST
GET /data-sources/course-details
RESPONSE
{
"data": [
{
"id": 5,
"product_id": 134,
"product_name": "30+ General English Core (Mornings Only)",
"course_type_id": 4,
"course_type_name": "General English 30+",
"min_age": 30,
"min_english_level_id": 4,
"possible_exam_id": 12,
"min_duration": 1,
"max_duration": 12,
"compulsory_fee_ids": [
{
"id": 89,
"name": "Registration fee",
"category": "registration"
},
{
"id": 212,
"name": "Materials fee",
"category": "tuition"
}
],
"possible_add_on_course_ids": [
208,
209,
368
],
"accom_type_ids": [
29,
59,
143,
90
],
"nbr_hours_week": "15",
"max_class_size": 8,
"dates": [
{
"start_date": "2020-04-13",
"end_dates": [
"2020-04-17",
"2020-04-24",
"2020-05-01",
"2020-05-08",
"2020-05-15",
"2020-05-22",
"2020-05-29",
"2020-06-05",
"2020-06-12",
"2020-06-19",
"2020-06-26",
"2020-07-03"
]
},
{
"start_date": "2020-04-20",
"end_dates": [
"2020-04-24",
"2020-05-01",
"2020-05-08",
"2020-05-15",
"2020-05-22",
"2020-05-29",
"2020-06-05",
"2020-06-12",
"2020-06-19",
"2020-06-26",
"2020-07-03",
"2020-07-10"
]
},
]
}
]
}
PARAMETERS
| Name | Type | Description |
|---|---|---|
| id | int | course detail id |
| product_id | int | Tuition product id |
| product_name | string | Tuition product name |
| course_type_id | int | Tuition type of course |
| course_type_name | string | Tuition type of course name |
| min_age | int | Minimum age required at the start of the course |
| min_english_level_id | int | Minimum level of English required. See English levels below. |
| possible_exam_id | int|null | Examination product id that a student can take at the end of a course |
| min_duration | int | Minimum booking duration in week |
| max_duration | int | Maximum booking duration in week |
| compulsory_fee_ids | null or array | Product which must be charged with this course. Each entry will have the product id, name and category to use for requesting its price. |
| possible_add_on_course_ids | null or array:int | Course product id possible as an add-on course |
| accom_type_ids | null or array:int | Accommodation type allowed for this course |
| nbr_hours_week | string | Information details, number of hours studied per week |
| max_class_size | int | Information details, number of student per class |
| dates | array | List of valid start date and their associated end dates formatted YYYY-MM-DD |
Course types
REQUEST
GET /data-sources/course-types
RESPONSE
{
"data": [
{
"id": 1,
"name": "General English courses",
"holidays": []
},
{
"id": 2,
"name": "Junior Summer courses",
"holidays": []
}
]
}
PARAMETERS
| Name | Type | Description |
|---|---|---|
| id | int | Course type id |
| name | string | Course type name |
| holidays | array string | Dates which the school will be closed for courses belonging to these course type |
English levels
List of english levels used by the school to assess student's level.
REQUEST
GET /data-sources/english-levels
RESPONSE
{
"data": [
{
"id": 2,
"name": "Beginner"
},
{
"id": 4,
"name": "Elementary"
},
{
"id": 6,
"name": "Pre-intermediate"
},
{
"id": 7,
"name": "Intermediate"
},
{
"id": 8,
"name": "Upper-intermediate"
},
{
"id": 10,
"name": "Advanced"
},
{
"id": 11,
"name": "Proficient"
}
]
}
Examinations
List of examination product provided by the school.
REQUEST
GET /data-sources/examinations
RESPONSE
{
"data": [
{
"product_id": 2,
"product_name": "Cambridge BULATS"
},
{
"product_id": 4,
"product_name": "Cambridge CAE"
},
{
"product_id": 6,
"product_name": "Cambridge CPE"
},
{
"product_id": 7,
"product_name": "Cambridge FCE"
},
{
"product_id": 8,
"product_name": "Upper-intermediate"
}
]
}
Nationalities
REQUEST
GET /data-sources/nationalities
RESPONSE
{
"data": [
{
"id": 115,
"nationality": "Afghan",
"request_deposit": 0
},
{
"id": 247,
"nationality": "Ålandish",
"request_deposit": 0
},
{
"id": 102,
"nationality": "Albanian",
"request_deposit": 0
},
{
"id": 59,
"nationality": "Algerian",
"request_deposit": 0
}
]
}
Prices
Submit a JSON payload, an array of product(s) following the below parameters and the response will be the same payload with prices for the requested product(s).
PARAMETERS
| Name | Type | Description |
|---|---|---|
| category | string | Valid types: registration, tuition, accommodation, transfer, examination Compulsory |
| product_id | integer | Compulsory |
| start | string | Start date formatted YYYY-MM-DD Compulsory for tuition accommodation |
| end | string | End date formatted YYYY-MM-DD Compulsory for tuition accommodation |
REQUEST
POST /prices/
[
{
"product_id": 50,
"category": "registration",
},
{
"product_id": 1,
"category": "tuition",
"start": "2020-07-06",
"end": "2020-07-31",
},
{
"product_id": 2,
"category": "tuition",
"start": "2020-08-03",
"end": "2020-08-28",
},
{
"product_id": 10,
"category": "accommodation",
"start": "2020-07-05",
"end": "2020-08-29",
},
{
"product_id": 20,
"category": "transfer",
}
]
RESPONSE
A valid response will return the submitted payload expanded with the quantity, amount and unit price.
[
{
"product_id": 50,
"category": "registration",
+ "prices": [
+ {
+ "description": "Registration fee",
+ "unit_price": 80,
+ "quantity": 1,
+ "amount": 80,
+ },
],
},
{
"product_id": 1,
"category": "tuition",
"start": "2020-07-06",
"end": "2020-07-31",
+ "prices": [
+ {
+ "start": "2020-07-06",
+ "end": "2020-07-31",
+ "description": "Full-Time General English 06/07/20 - 31/07/20\n4 Weeks x £295.00",
+ "unit_price": 295,
+ "quantity": 4,
+ "amount": 1180,
+ },
+ ],
},
{
"product_id": 2,
"category": "tuition",
"start": "2020-08-03",
"end": "2020-08-28",
+ "prices": [
+ {
+ "start": "2020-08-03",
+ "end": "2020-08-28",
+ "description": "Full-Time Intensive General English 03/08/20 - 28/08/20\n4 Weeks x £325.00",
+ "unit_price": 325,
+ "quantity": 4,
+ "amount": 1625,
+ },
+ ],
},
{
"product_id": 10,
"category": "accommodation",
"start": "2020-07-05",
"end": "2020-08-29",
+ "prices": [
+ {
+ "start": "2020-07-05",
+ "end": "2020-07-31",
+ "description": "Homestay 05/07/20 - 31/07/20\n4 Weeks x £165.00",
+ "unit_price": 165,
+ "quantity": 4,
+ "amount": 660,
+ },
+ {
+ "start": "2020-08-01",
+ "end": "2020-08-29",
+ "description": "Homestay 01/08/20 - 29/08/20\n4 Weeks x £185.00",
+ "unit_price": 185,
+ "quantity": 4,
+ "amount": 740,
+ },
+ ],
},
{
"product_id": 20,
"category": "transfer",
+ "prices": [
+ {
+ "description": "Airport Transfer from London Heathrow",
+ "unit_price": 110,
+ "quantity": 1,
+ "amount": 110,
+ },
+ ],
},
]
An invalid request will have a response specifying the error message.
[
{
"product_id": 1,
"category": "tuition",
"start": "2020-07-06",
+ "errors": {
+ "end": "Missing 'end' date parameter",
+ },
},
{
"product_id": 2,
"category": "tuition",
"end": "2020-08-28",
+ "errors": {
+ "start": "Missing 'start' date parameter",
+ },
},
{
"product_id": 10,
"category": "accommodation",
+ "errors": {
+ "start": "Missing 'start' date parameter",
+ "end": "Missing 'end' date parameter",
+ },
},
]
Enrolment request
Submitting an enrolment
REQUEST
POST /api/enrolments/create
PARAMETERS
| Name | Type | Description |
|---|---|---|
| reference | string | required, unique |
| first_name | string | required |
| last_name | string | required |
| required | ||
| nationality_id | integer | required, existing in Nationalities |
| gender | string | M,F |
| date_of_birth | date | required |
| english_level_id | integer | required, existing in English levels |
| phone | string | optional |
| address | string | optional |
| occupation | string | optional |
| school_discovery_source | string | optional |
| comments | string | optional |
| course_id | integer | required, existing in Course details |
| course_start | date | required |
| course_end | date | required |
| is_accommodated_by_school | boolean | required |
| accommodation_type_id | integer | required if is_accommodated_by_school=1, existing in Accommodation types |
| is_smoker | boolean | required if is_accommodated_by_school=1 |
| accommodation_start_date | date | required if is_accommodated_by_school=1 |
| accommodation_end_date | date | required if is_accommodated_by_school=1 |
| accommodation_requirements | string | |
| transfer_arrival_id | integer | existing in Airport transfers |
| transfer_departure_id | integer | existing in Airport transfers |
| emergency_contact | string | |
| emergency_contact_relation | string | |
| emergency_contact_phone | string | |
| emergency_contact_email | ||
| is_completed | boolean | required |
| extra_data | array |
RESPONSE
Upon a successfull POST the reponse will a JSON object with the submitted data plus the id field.
{
"id": 42,
"client_id": 42,
"reference": "SOME-REFERENCE",
"first_name": "...",
"last_name": "...",
"email": "test@email.com",
"nationality_id": 1,
"gender": null,
"date_of_birth": "1980-12-12 00:00:00",
"english_level_id": 7,
"is_sponsored_student": false,
"phone": null,
"address": null,
"occupation": "",
"school_discovery_source": null,
"comments": null,
"emergency_contact": null,
"emergency_contact_relation": null,
"emergency_contact_phone": null,
"emergency_contact_email": null,
"company_name": "",
"is_company_funded": null,
"company_position": "",
"company_description": "",
"company_department": "",
"company_job_description": null,
"course_id": 123,
"course_start": "2019-10-07 00:00:00",
"course_end": "2019-11-22 00:00:00",
"is_accommodated_by_school": true,
"accommodation_type_id": 32,
"is_smoker": false,
"accommodation_start_date": "2019-10-06 00:00:00",
"accommodation_end_date": "2019-11-23 00:00:00",
"accommodation_requirements": null,
"transfer_arrival_id": 1,
"transfer_departure_id": 1,
"is_completed": true,
"payment_id": 0,
"deposit_amount": 0,
"extra_data": [],
"completed_stage": 2,
"created_at": "2019-08-19 16:55:18",
"updated_at": "2019-08-19 16:55:48",
"migration_status": "downloaded",
"booking_id": 0,
"name": "...",
"nationality": "Selected Nationality name",
"course": "Selected Course name",
"accommodation": "Selected Accommodation name",
"transfers": {
"in": "Selected Airport name",
"out": "Selected Airport name"
}
}
Retrieving an enrolment
REQUEST
GET /api/enrolments/{id}
RESPONSE
A JSON object of the submitted enrolment data as shown above.
Files
Endpoint to access files associated with a student booking.
List of files
REQUEST
GET /api/student-booking/{booking_id}/files
RESPONSE
A JSON object listing any file id.
[
{
id: 1234,
filename: 'Confirmation letter.pdf',
content_type: 'application/pdf',
},
{
id: 4567,
filename: 'Accommodation confirmation.pdf',
content_type: 'application/pdf',
},
]
Retrieving a file
REQUEST
GET /api/student-booking/{booking_id}/files/{file_id}
RESPONSE
The requested file content.