⚠️ APIv2 is legacy
APIv2 is considered legacy and is no longer recommended for new integrations.
We strongly encourage you to use APIv4 for all new integrations and to migrate existing integrations where possible.
Please refer to our latest APIv4 documentation for up-to-date information and integration guidelines:
Click here to view the APIv4 example documentation - your own documentation is at https://[your-instance].langlion.com/api/v4/docs
List all teachers - GET /api/v2/teachers
Returns a list of the all teachers (including archived). Teachers are returned sorted by 'id' field in increasing order.
Request
1curl -G 'https://test.langlion.com/api/v2/teachers' \
2--header 'Authorization: Bearer af2b3df9c671d5413fc5c38b467794782b4047705ac3...'Response
1{
2 "data": {
3 "teachers": [
4 {
5 "id": 3,
6 "color": "33CCFF",
7 "createdAt": "2020-10-19 16:30:06",
8 "updatedAt": "2022-07-12 13:23:14",
9 "user": {
10 "id": 7,
11 "login": "alektorski",
12 "name": "Adam",
13 "firstName": "Adam",
14 "lastName": "Lektorski",
15 "fullname": "Adam Lektorski",
16 "systemRole": "teacher",
17 "isArchived": 1,
18 "photo": null,
19 "language": "pl_PL",
20 "tosAccepted": 1,
21 "type": null,
22 "typeName": null,
23 "createdAt": "2020-10-19 16:30:06",
24 "updatedAt": "2022-07-12 13:23:14",
25 "additionalData": {
26 "id": 5,
27 "phone": null,
28 "mobile": null,
29 "email": "alektorski@langlion.com",
30 "skype": null,
31 "street": null,
32 "zipCode": null,
33 "city": null,
34 "country": null,
35 "post": null,
36 "province": null,
37 "pesel": null,
38 "nipNumber": null,
39 "birthDate": null,
40 "birthPlace": null,
41 "description": null,
42 "billingName": null,
43 "billingStreet": null,
44 "billingCity": null,
45 "billingZipCode": null,
46 "billingNipNumber": null,
47 "billingPesel": null,
48 "billingEmail": null,
49 "createdAt": "2020-10-19 16:30:06",
50 "updatedAt": "2022-07-12 13:23:03"
51 },
52 "parentUser": null
53 }
54 },
55 {
56 "id": 4,
57 "color": "FF00FF",
58 "createdAt": "2020-10-27 16:32:12",
59 "updatedAt": "2021-10-06 15:40:48",
60 "user": {
61 "id": 12,
62 "login": "majk",
63 "name": "Klara",
64 "firstName": "Klara",
65 "lastName": "Maj",
66 "fullname": "Klara Maj",
67 "systemRole": "teacher",
68 "isArchived": 0,
69 "photo": null,
70 "language": "pl_PL",
71 "tosAccepted": 1,
72 "type": null,
73 "typeName": null,
74 "createdAt": "2020-10-27 16:32:12",
75 "updatedAt": "2023-11-14 12:16:29",
76 "additionalData": {
77 "id": 10,
78 "phone": null,
79 "mobile": null,
80 "email": "pch+teacher@langlion.com",
81 "skype": null,
82 "street": null,
83 "zipCode": null,
84 "city": null,
85 "country": null,
86 "post": null,
87 "province": null,
88 "pesel": null,
89 "nipNumber": null,
90 "birthDate": null,
91 "birthPlace": null,
92 "description": null,
93 "billingName": null,
94 "billingStreet": null,
95 "billingCity": null,
96 "billingZipCode": null,
97 "billingNipNumber": null,
98 "billingPesel": null,
99 "billingEmail": null,
100 "createdAt": "2020-10-27 16:32:12",
101 "updatedAt": "2024-04-17 17:45:23"
102 },
103 "parentUser": null
104 }
105 },
106 [...]Parameters
Required
No required parameters.
Optional
- filter - JSON filter
- recordFrom - fetch records from
- recordTo - fetch record up to
- userId - filter by user id
- schoolId - filter by school id
- createdAt - filter by user's date of creation
- updatedAt - filter by user's date of creation
Create teacher - POST /api/v2/teacher
Request
1curl --location 'https://test.langlion.com/api/v2/teacher' \
2--header 'Authorization: Bearer 6c90089aaab4fafc84a[...]' \
3--form 'firstname="John"' \
4--form 'lastname="Smith"' \
5--form 'email="jsmith@langlion.com"' \
6--form 'schoolId="1"'Response
1{
2 "data": {
3 "teacher": {
4 "id": 53,
5 "color": "DDE5F6",
6 "createdAt": "2024-05-19 20:43:14",
7 "updatedAt": "2024-05-19 20:43:14",
8 "user": {
9 "id": 1962,
10 "login": "1753731",
11 "name": "John",
12 "firstName": "John",
13 "lastName": "Smith",
14 "fullname": "John Smith",
15 "systemRole": "teacher",
16 "isArchived": "0",
17 "photo": null,
18 "language": "pl_PL",
19 "tosAccepted": null,
20 "type": 0,
21 "typeName": "normal",
22 "createdAt": "2024-05-19 20:43:14",
23 "updatedAt": "2024-05-19 20:43:14",
24 "additionalData": {
25 "id": 1779,
26 "phone": null,
27 "mobile": null,
28 "email": "jsmith@langlion.com",
29 "skype": null,
30 "street": null,
31 "zipCode": null,
32 "city": null,
33 "country": null,
34 "post": null,
35 "province": null,
36 "pesel": null,
37 "nipNumber": null,
38 "birthDate": null,
39 "birthPlace": null,
40 "description": null,
41 "billingName": null,
42 "billingStreet": null,
43 "billingCity": null,
44 "billingZipCode": null,
45 "billingNipNumber": null,
46 "billingPesel": null,
47 "billingEmail": null,
48 "createdAt": "2024-05-19 20:43:14",
49 "updatedAt": "2024-05-19 20:43:14"
50 },
51 "parentUser": null,
52 "oneTimePassword": "6w88nSSOK6"
53 }
54 }
55 }
56}In response there are returned one time passwords (OTP) for teacher and parent which could be provided to teacher for login
Parameters
Required
- firstname - teacher's firstname
- lastname - teacher's lastname
- email - teacher's email
- schoolId - assign teacher to the school using school ID
Optional
- type - user's type (default: normal)
Update teacher - PATCH /api/v2/teacher
Request
1curl --location --request PATCH 'https://test.langlion.com/api/v2/teacher' \
2--header 'Authorization: Bearer 6c90089aaab4fafc84aedc3996500[...]' \
3--form 'firstname="John"' \
4--form 'lastname="Cook"' \
5--form 'email="jsmith@langlion.com"' \
6--form 'id="53"'Response
1{
2 "data": {
3 "teacher": {
4 "id": 53,
5 "color": "DDE5F6",
6 "createdAt": "2024-05-19 20:43:14",
7 "updatedAt": "2024-05-19 20:43:14",
8 "user": {
9 "id": 1962,
10 "login": "7761526",
11 "name": "John",
12 "firstName": "John",
13 "lastName": "Cook",
14 "fullname": "John Cook",
15 "systemRole": "teacher",
16 "isArchived": 0,
17 "photo": null,
18 "language": "pl_PL",
19 "tosAccepted": null,
20 "type": 0,
21 "typeName": "normal",
22 "createdAt": "2024-05-19 20:43:14",
23 "updatedAt": "2024-05-19 20:45:00",
24 "additionalData": {
25 "id": 1779,
26 "phone": null,
27 "mobile": null,
28 "email": "jsmith@langlion.com",
29 "skype": null,
30 "street": null,
31 "zipCode": null,
32 "city": null,
33 "country": null,
34 "post": null,
35 "province": null,
36 "pesel": null,
37 "nipNumber": null,
38 "birthDate": null,
39 "birthPlace": null,
40 "description": null,
41 "billingName": null,
42 "billingStreet": null,
43 "billingCity": null,
44 "billingZipCode": null,
45 "billingNipNumber": null,
46 "billingPesel": null,
47 "billingEmail": null,
48 "createdAt": "2024-05-19 20:43:14",
49 "updatedAt": "2024-05-19 20:43:14"
50 },
51 "parentUser": null,
52 "oneTimePassword": "Lzz9mDipWU"
53 }
54 }
55 }
56}In response there are returned one time passwords (OTP) for teacher which could be provided to teacher
Parameters
Required
- id - id of teacher
Optional
- firstname - teacher's firstname
- lastname - teacher's lastname
- email - teacher's email