API Documentation
API Endpoint
https://collegecode.linways.com/api/v1Linways AMS API
Linways AMS API is a RESTful API that can be used to interact with Linways AMS.
Root URL and Current version
Current Version
The current version of Linways AMS API is v1.
Root URL for accessing the API
Root URL: https://<collegeCode>.linways.com/api/v1
collegeCode
is the subdomain assigned to each institution.
All Linways AMS API access is over HTTPS.
Authentication
Every request to access the API must contain Authorization
header with a valid API_ACCESS_TOKEN
for a particular institution.
curl -H "Authorization: API_ACCESS_TOKEN" <API_ENDPOINT>
Example
curl -H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
eyJhSWQiOiI2NTJkYzAwNTI5ZmJiYjhhYjQ3YyIsImNJZCI6MTI1Miwib0lkIjox
LCJpYXQiOjE1MjExNzU3NzR9.mC0fuwtEsHZWYl545d9r_zof6kOJf2Kb--6TVha
6rzk" https://demo.linways.com/api/v1/students/2
Pagination
For API endpoints with pagination, the pagination information will be available in _meta
part of the response.
You can use the following parameters to interact with the pagination.
Parameter | Description |
---|---|
_page |
Page number to be accessed. Default = 1 |
_pageSize |
Number of items per page. Default = 50 , Maximum = 500 |
Example usage: To get 2nd page with page size 100. ie., to access entries from 101 to 200.
/api/v1/students?_page=2&_pageSize=100
You can add pagination parameters with any other filters/parameters available. Example:
/api/v1/students?gender=female&_page=2&_pageSize=100
Students ¶
Student Endpoints ¶
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
[
"_meta": {
"totalRecords": "1813",
"currentPage": "1",
"hasNextPage": true,
"recordsFrom": 1,
"recordsTo": 50
},
"data":[
{
"id": "1",
"name": "Gollum",
"admissionNumber": "14BBE11-12301"
},
{
"id": "2",
"name": "Balin",
"admissionNumber": "14ABD11-12331"
},
{
"id": "3",
"name": "Azog",
"admissionNumber": "114BB11-12391"
},
{
"id": "4",
"name": "Gandalf",
"admissionNumber": "152BE11-12301"
}
...
]
]
Get all students / search studentsGET/students
Get details of all students in the institution.
This API is paginated. Refer Pagination section for info.
Filters
Any of the parameters can be used to filter the students.
Parameter | Description |
---|---|
id |
Student ID in Linways AMS |
deptId |
ID if Department (can be obtained from /api/v1/departments ) |
batchId |
ID of Batch (can be obtained from /api/v1/batches ) |
username |
Username used to login to Linways AMS |
name |
Student name |
email |
Student email address |
gender |
Gender of student. |
phoneNo |
Student phone number |
category |
Reservation category. (Eg: OBC, GENERAL etc.) |
bloodGroup |
Blood group |
admissionNo |
Admission number |
admissionQuota |
Admission Quota (Eg: NRI, MANAGEMENT, GOVERNMENT etc.) |
religion |
Religion |
caste |
Caste |
Example Usage :
/api/v1/[email protected]
For URL unsafe characters, it is recommended to URL-encode the value.
Example: For filtering students with O+ blood group.
/api/v1/students?bloodGroup=O%2B
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": "1",
"admissionNumber": "14BBE11-12301",
"rollNumber": "37",
"registerNumber": "GOAOEAE009",
"name": "Gollum",
"surName": "",
"lastName": "",
"email": "[email protected]",
"gender": "male",
"profilePicture": "/api/v1/students/1/profile-picture/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrZXkiOiIxIiwiaWF0IjoxNTM2NDE3MjQxLCJleHAiOjE1MzY0MTgxNDF9.GD06N98iBeJsjnPNrMlnWg0QRYql0B_Tpdva-qK-zFM",
"dob": "1964-04-20",
"address": "gollum address",
"homeTown": "",
"phone": "9999999999",
"fatherName": "father",
"motherName": "mother",
"category": "OBC",
"religion": "HINDU",
"community": "NAIR",
"bloodGroup": "AB-",
"admissionType": "Govt",
"isLateralEntry": "0",
"isNRIQuota": "0",
"joinDate": "2017-07-03",
"SSLCMark": "0",
"PlusTwoMark": "0",
"isHosteller": "0",
"parentPhone": "9999999999",
"experience": null,
"yearOfPassing": null,
"qualification": null,
"tcIssued": "0",
"exitType": null,
"rfId": null,
"department": {
"id": "1",
"name": "AEI",
"description": "APPLIED ELECTRONICS AND INSTRUMENTATION"
},
"batch": {
"id": "4",
"name": "AEI2014",
"description": "AEI2014"
}
}
Get individual student details by IDGET/students/{id}
Get Student Details By Id.
Note
URL in profilePicture field will only be valid for 20 minutes- id
number
(required) Example: 1An unique identifier.
Fail/Discontinue ¶
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
"studentId": "23",
"exitType": "FAILED"
}
Headers
Content-Type: application/json
Body
{
"status": "success"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Update failed",
"errorCode": "UPDATE_FAILED"
}
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
"admissionNo": "ABCD-21",
"exitType": "DISCONTINUED"
}
Headers
Content-Type: application/json
Body
{
"status": "success"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Update failed",
"errorCode": "UPDATE_FAILED"
}
Move student to failed listPOST/students/move/failed-list
This endpoint let you move a student to failed list or discontinued list
Parameters
Variable | Type | Description |
---|---|---|
studentId | integer | Id of the student in Linways AMS.(can be obtained using /students endpoint) |
admissionNo | string | College admission number (as specified in Linways AMS |
exitType | string | Default: FAILED use FAILED for moving student into failed list. DISCONTINUED for discontinued student list |
Note
EitherstudentId
or admissionNo
need to be specified in a request.If both are set only studentId will be considered.
Error Codes
Code | Description |
---|---|
STUDENT_REQUIRED | If student Id and admission number both are undefined |
INVALID_EXIT_TYPE | If the exit type specified is not valid |
ADMISSION_NO_ERROR | No student corresponding to the admission number |
STUDENT_ALREADY_IN_FAILED_LIST | If student is already in failed list |
UPDATE_FAILED | If student id / admission number specified is invalid. |
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
"studentId": "23"
}
Headers
Content-Type: application/json
Body
{
"status": "success"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Update failed",
"errorCode": "UPDATE_FAILED"
}
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
"admissionNo": "ABCD-21"
}
Headers
Content-Type: application/json
Body
{
"status": "success"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Update failed",
"errorCode": "UPDATE_FAILED"
}
Move student back from failed listPOST/students/move/failed-list/revert
This endpoint let you move a student in failed list back to his/her original batch
Variable | Type | Description |
---|---|---|
studentId | integer | Id of the student in Linways AMS.(can be obtained using /students endpoint) |
admissionNo | string | College admission number (as specified in Linways AMS |
Error Codes
Code | Description |
---|---|
STUDENT_REQUIRED | If student Id and admission number both are undefined |
ADMISSION_NO_ERROR | No student corresponding to the admission number |
UPDATE_FAILED | If student not in failed list |
Staffs ¶
Staff Endpoints ¶
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": 1,
"name": "Atticus Finch",
"loginId": "E301",
"code": "AF"
"lectureTypeName": "Regular"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "An unique identifier."
},
"name": {
"type": "string",
"description": "The name of the staff."
},
"loginId": {
"type": "string",
"description": "The username used to login to Linways AMS"
},
"code": {
"type": "string",
"description": "Unique code to identify each staff."
}
}
}
Get all staffsGET/staffs
List all staffs.
Filters
Any of the parameters can be used to filter the staffs.
Parameter | Description |
---|---|
excludeResignedStaff | For excluding resigned staff set value to true |
Example Usage :
/api/v1/staffs?excludeResignedStaff=true
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": "1",
"name": "Atticus Finch",
"loginId": "E301",
"email": "[email protected]",
"gender": "male",
"dob": "1970-01-01",
"address": "sampleAddress",
"department": {
"id": "11",
"name": "OFFICE",
"description": "OFFICE"
},
"academicDesignation": {
"id": "1",
"name": "Secretary",
"description": ""
},
"phone": "1234567890",
"code": "1",
"isTeachingFaculty": "0",
"isResigned": "0",
"otherDesignation": "",
"dateOfJoining": "2007-03-14",
"bloodGroup": "A+",
"aicteCode": null,
"lectureTypeName": "Regular",
"profilePicture": "/api/v1/staffs/1/profile-picture/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MzYzMjk2ODAsImV4cCI6MTUzNjMzMDU4MH0.qrtdKX2TJ9Fzkxwvm6iOZ6MIZ12_noeX4S3WXtHRGuQ"
}
Get individual staff details by IDGET/staffs/{id}
Get Staff Details By Id.
Note
URL in profilePicture field will only be valid for 20 minutes- id
number
(required) Example: 1An unique identifier.
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": "2001",
"name": "staff name",
"gender": "female",
"dob": "1966-08-20",
"phone": "0000",
"email": "[email protected]",
"designation": "Associate Professor",
"department": {
"id": "4",
"code": "EEE",
"name": "Electrical and Electronics Engineering"
},
"profileSections": [
{
"name": "Academic Background",
"content": "<p>Lorem ipsum dolor Per fugit quodsi perpetua an, per copiosae appellantur eu, nec te fierent disputationi. Tractatos delicatissimi eum ut. Usu reque principes no.</p>"
},
{
"name": "Areas of Interest ",
"content": "<p>Lorem ipsum dolor sit amet, an duo graeco mediocrem, in duo duis reprimique definitiones. Nisl appetere postulant te per, minim dicant eirmod te pri.</p>"
},
{
"name": "Significant Publications",
"content": "<p><ol><li>Lorem ipsum dolor sit amet, an duo graeco mediocrem,</li><li>in duo duis reprimique definitiones. Nisl appetere postulant te per,</li><li>minim dicant eirmod te pri. Duo nisl singulis ut, nisl hinc ius cu.</li></ol></p>"
}
],
"profilePicture": "/api/v1/staffs/1/profile-picture/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MzYzMjk2ODAsImV4cCI6MTUzNjMzMDU4MH0.qrtdKX2TJ9Fzkxwvm6iOZ6MIZ12_noeX4S3WXtHRGuQ"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Could not find any records",
"errorCode": "NO_RECORD_FOUND"
}
Get public profile detailsGET/staffs/public-profile/{id}
Get details of staff public profile.
URL Parameters
variable | type | description |
---|---|---|
id | number | ID of staff in linways ams. |
Caution
Special characters inprofileSections[i].content
are converted to HTML entities.
So you might need to convert it back to HTML before rendering.This field is not sanitised (It might contain XSS vulnerable elements). Rendering this content without proper precuations are dangerous.
Read more about Cross-site scripting here
Note
URL in profilePicture field will only be valid for 20 minutesError Codes
Code | Description |
---|---|
STAFF_ID_REQUIRED | Staff Id is required |
NO_RECORD_FOUND | Could not find any records for specieid staff/ invalid staff id |
PUBLIC_PROFILE_NOT_ENABLED | Public profile not enabled. |
NOT_AVAILABLE | Not available under your subscription. Public profiles are only available in Enterprise version. |
PERMISSION_DENIED | Your API access key does not have permission to access this info |
- id
number
(required) Example: 2001ID of staff in linways ams.
Staff Attendance ¶
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
"loginId": "E301",
"date": "2018-11-03",
"inTime": "09:54:33",
"outTime": "18:05:00"
}
Headers
Content-Type: application/json
Body
{
"status": "success"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Invalid date",
"errorCode": "INVALID_DATE"
}
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
"staffId": "782",
"date": "2018-11-03",
"inTime": "09:54:33",
"outTime": "18:05:00"
}
Headers
Content-Type: application/json
Body
{
"status": "success"
}
Headers
Content-Type: application/json
Body
{
"status": "error",
"errorMessage": "Invalid date",
"errorCode": "INVALID_DATE"
}
Save staff AttendancePOST/staffs/attendance
Save staff attendance information. This API endpoint can be used to automatically update the punch-in and punch-out details from biometric device.
Parameters
Variable | Type | Description |
---|---|---|
staffId | integer (recommended) |
Id of the staff in Linways AMS.(can be obtained using /staffs endpoint) [Either staffId or loginId is required] |
loginId | string | Login username used by the staff to login to Linways AMS (Usually this will the employee code). [Either staffId or loginId is required] |
date | string | Date in YYYY-MM-DD format at which the attendance need to be marked. |
inTime | string (optional) |
Punch in time in HH:MM:SS format (24 hour format) |
outTime | string (optional) |
Punch out time in HH:MM:SS format (24 hour format) |
Caution
Linways AMS only stores first inTime and last outTime for a particular date.If the inTime in a request is greater than the value already stored for that day, the new value will be ignored. Similarly, Linways AMS will only update the outTime if it is greater than the current value for that particular staff for that particular day.
Note
You can invoke this endpoint only with inTime or only with outTime if required.Error Codes
Code | Description |
---|---|
ID_REQUIRED | If both staff Id and loginId are undefined |
INVALID_DATE | If date is invalid. Date must be in YYYY-MM-DD format |
INVALID_IN_TIME | If inTime is invalid. inTime should be in the HH:MM:SS format (24 hours) |
INVALID_OUT_TIME | If outTime is invalid. inTime should be in the HH:MM:SS format (24 hours) |
INVALID_INPUT | In input is invalid, except the above mentioned errors |
Batches ¶
Batch Endpoints ¶
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": 1,
"name": "AEI2017",
"description": "AEI2017",
"startYear": 2017,
"endYear": 2021
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "An unique identifier."
},
"name": {
"type": "string",
"description": "The name of the batch."
},
"description": {
"type": "string",
"description": "Description of the batch."
},
"startYear": {
"type": "number",
"description": "Start year."
},
"endYear": {
"type": "number",
"description": "End year."
}
}
}
Get all batchesGET/batches
List all batches.
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": "3",
"name": "AEI2016",
"description": "",
"startYear": "2016",
"endYear": "2020",
"currentSemester": {
"id": "4",
"name": "S4",
"year": "2"
},
"department": {
"id": "1",
"name": "AEI",
"description": "APPLIED ELECTRONICS AND INSTRUMENTATION"
},
"totalSemester": null,
"stream": ""
}
Get individual batch details by IDGET/batches/{id}
Get Batch Details By Id.
- id
number
(required) Example: 1An unique identifier.
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
[
"_meta": {
"totalRecords": "12",
"currentPage": "1",
"hasNextPage": false,
"recordsFrom": 1,
"recordsTo": 12
},
"data": [
{
"id": "1",
"name": "Gollum",
"admissionNumber": "14BBE11-12301"
},
{
"id": "2",
"name": "Balin",
"admissionNumber": "14ABD11-12331"
},
{
"id": "3",
"name": "Azog",
"admissionNumber": "114BB11-12391"
},
{
"id": "4",
"name": "Gandalf",
"admissionNumber": "152BE11-12301"
}
...
]
]
Get students of a particular batchGET/batches/{id}/students
Get Students Belonging To A Particular Batch.
- id
number
(required) Example: 1An unique identifier.
Departments ¶
Departments Endpoints ¶
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Create departmentPOST/departments
Creates a new department.
Update departmentPUT/departments/
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": 1,
"name": "AEI",
"description": "APPLIED ELECTRONICS AND INSTRUMENTATION"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "An unique identifier."
},
"name": {
"type": "string",
"description": "Name of the department."
},
"description": {
"type": "string",
"description": "Description of the department."
}
}
}
Get all departmentsGET/departments
List all departments.
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": 1,
"name": "AEI",
"description": "APPLIED ELECTRONICS AND INSTRUMENTATION"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "An unique identifier."
},
"name": {
"type": "string",
"description": "Name of the department."
},
"description": {
"type": "string",
"description": "Description of the department."
}
}
}
Get individual department details by IDGET/departments/
Get Department Details By Id.
Delete DepartmentDELETE/departments/
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
[
"_meta": {
"totalRecords": "244",
"currentPage": "1",
"hasNextPage": true,
"recordsFrom": 1,
"recordsTo": 50
},
"data": [
{
"id": "1",
"name": "Gollum",
"admissionNumber": "14BBE11-12301"
},
{
"id": "2",
"name": "Balin",
"admissionNumber": "14ABD11-12331"
},
{
"id": "3",
"name": "Azog",
"admissionNumber": "114BB11-12391"
},
{
"id": "4",
"name": "Gandalf",
"admissionNumber": "152BE11-12301"
}
]
]
Get students of a particular departmentGET/departments/{id}/students
Get Students Belonging To A Particular Department.
- id
number
(required) Example: 1An unique identifier.
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Headers
Content-Type: application/json
Body
{
"id": 1,
"name": "Tom Robinson",
"code": "1MB"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "An unique identifier."
},
"name": {
"type": "string",
"description": "The name of the staff."
},
"code": {
"type": "string",
"description": "Unique code to identify each staff."
}
}
}
Get staffs of a particular departmentGET/departments/{id}/staffs
Get Staffs Belonging To A Particular Department.
Filters
Any of the parameters can be used to filter the staffs.
Parameter | Description |
---|---|
excludeResignedStaff | For excluding resigned staff set value to true |
includeStaffImage | For including staff profile image set value to true |
- id
number
(required) Example: 1An unique identifier.
Generated by aglio on 02 Nov 2021