⚠️ 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 custom fields - GET /api/v2/fields
Returns a list of custom fields for specific form defined in forms settings.
Request
1curl -G 'https://test.langlion.com/api/v2/fields' \
2--form 'form="Student"' \
3--header 'Authorization: Bearer af2b3df9c671d5413fc5c38b467794782b4047705ac3...'Response
1{
2 "data": {
3 "fields": [
4 {
5 "id": 1,
6 "title": "Skąd się o nas dowiedziałeś?",
7 "description": null,
8 "defaultValue": null,
9 "createdAt": "2017-12-18 16:04:20",
10 "updatedAt": "2017-12-18 16:04:41"
11 }
12 ]
13 }
14}Parameters
Required
- form - fetch custom fields for form
Supported values: Teacher, Student, Course, Group, Classroom, Client, Transaction, Invoice, CounterDocument, School, User, MediaLib, Department, FileList, Test, Product, SMS, SchoolClassStudent
Optional
No optional parameters.
Get custom fields values for object - GET /api/v2/fieldValues
Returns a list of values of custom fields for specific object.
Request
1curl -G 'https://test.langlion.com/api/v2/fieldValues' \
2--header 'Authorization: Bearer af2b3df9c671d5413fc5c38b467794782b4047705ac3Response
1{
2 "data": {
3 "fieldValue": {
4 "id": 2863,
5 "value": "Some answer",
6 "valueFormatted": "Some answer",
7 "createdAt": "2023-12-20 20:33:55",
8 "updatedAt": "2023-12-20 20:33:55",
9 "objectId": 783,
10 "objectName": "Student",
11 "field": {
12 "id": 214,
13 "title": "Some question?",
14 "description": null,
15 "defaultValue": null,
16 "createdAt": "2022-11-29 13:04:26",
17 "updatedAt": "2023-12-20 19:12:28"
18 }
19 }
20 }
21}Parameters
Required
- objectId - id of object to fetch custom field's value
- objectName - type of object
Supported values: Teacher, Student, SchoolClass, Client, SchoolClassStudent, Course
Update or create custom field value - PUT /api/v2/fieldValue
Update value of custom field for specific object. If field value does not exist create it.
Request
1curl --location --request PATCH
2'test.langlion.com/api/v2/fieldValue?fieldId=214&value=78&objectId=783&objectName=Student' \
3--header 'Authorization: Bearer d4015283bf6d86ee12a8c583840a91ce29de95f1defc860d0c4f31ae10c[...]
4--form 'fieldId="214"' \
5--form 'value="some value"' \
6--form 'objectId="783"' \
7--form 'objectName="Student"'Response
1{
2 "data": {
3 "fieldValue": {
4 "id": 2863,
5 "value": "Some answer",
6 "valueFormatted": "Some answer",
7 "createdAt": "2023-12-20 20:33:55",
8 "updatedAt": "2023-12-20 20:33:55",
9 "objectId": 783,
10 "objectName": "Student",
11 "field": {
12 "id": 214,
13 "title": "Some question?",
14 "description": null,
15 "defaultValue": null,
16 "createdAt": "2022-11-29 13:04:26",
17 "updatedAt": "2023-12-20 19:12:28"
18 }
19 }
20 }
21}Parameters
Required
- fieldId - id of form's field (eg. returned in the list of all custom fields)
- objectId - id of object to set value for
- objectName - type of object
Supported values: Teacher, Student, SchoolClass, Client, SchoolClassStudent, Course - value - value of field - it could be string or integer (eg. id of item on the list)