API Documentation

Linways 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

GET https://collegecode.linways.com/api/v1/students
RequestsAll Students
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 students
GET/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

GET https://collegecode.linways.com/api/v1/students/1
RequestsStudent Details
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 ID
GET/students/{id}

Get Student Details By Id.

Note

URL in profilePicture field will only be valid for 20 minutes
 
URI Parameters
HideShow
id
number (required) Example: 1

An unique identifier.


Fail/Discontinue

POST https://collegecode.linways.com/api/v1/students/move/failed-list
RequestsUsing Student IDUsing Admission No.
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
  "studentId": "23",
  "exitType": "FAILED"
}
Responses200400
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"
}
Responses200400
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 list
POST/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

Either studentId 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.

POST https://collegecode.linways.com/api/v1/students/move/failed-list/revert
RequestsUsing Student IDUsing Admission No.
Headers
Accept: application/json
Content-Type: application/json
Authorization: API_ACCESS_TOKEN
Body
{
  "studentId": "23"
}
Responses200400
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"
}
Responses200400
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 list
POST/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

GET https://collegecode.linways.com/api/v1/staffs
RequestsAll Staffs
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 staffs
GET/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

GET https://collegecode.linways.com/api/v1/staffs/1
RequestsStaff Details
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 ID
GET/staffs/{id}

Get Staff Details By Id.

Note

URL in profilePicture field will only be valid for 20 minutes
 
URI Parameters
HideShow
id
number (required) Example: 1

An unique identifier.


GET https://collegecode.linways.com/api/v1/staffs/public-profile/2001
RequestsStaff Details
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200400
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": "&lt;p&gt;Lorem ipsum dolor  Per fugit quodsi perpetua an, per copiosae appellantur eu, nec te fierent disputationi. Tractatos delicatissimi eum ut. Usu reque principes no.&lt;/p&gt;"
    },
    {
      "name": "Areas of Interest ",
      "content": "&lt;p&gt;Lorem ipsum dolor sit amet, an duo graeco mediocrem, in duo duis reprimique definitiones. Nisl appetere postulant te per, minim dicant eirmod te pri.&lt;/p&gt;"
    },
    {
      "name": "Significant Publications",
      "content": "&lt;p&gt;&lt;ol&gt;&lt;li&gt;Lorem ipsum dolor sit amet, an duo graeco mediocrem,&lt;/li&gt;&lt;li&gt;in duo duis reprimique definitiones. Nisl appetere postulant te per,&lt;/li&gt;&lt;li&gt;minim dicant eirmod te pri. Duo nisl singulis ut, nisl hinc ius cu.&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;"
    }
  ],
  "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 details
GET/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 in profileSections[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 minutes
 

Error 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
URI Parameters
HideShow
id
number (required) Example: 2001

ID of staff in linways ams.


Staff Attendance

POST https://collegecode.linways.com/api/v1/staffs/attendance
RequestsUsing loginId / employee IDUsing Staff ID
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"
}
Responses200400
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"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "status": "success"
}
Headers
Content-Type: application/json
Body
{
  "status": "error",
  "errorMessage": "Invalid date",
  "errorCode": "INVALID_DATE"
}

Save staff Attendance
POST/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

GET https://collegecode.linways.com/api/v1/batches
RequestsAll Batches
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 batches
GET/batches

List all batches.


GET https://collegecode.linways.com/api/v1/batches/1
RequestsBatch Details
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 ID
GET/batches/{id}

Get Batch Details By Id.

URI Parameters
HideShow
id
number (required) Example: 1

An unique identifier.


GET https://collegecode.linways.com/api/v1/batches/1/students
RequestsStudents in a batch
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 batch
GET/batches/{id}/students

Get Students Belonging To A Particular Batch.

URI Parameters
HideShow
id
number (required) Example: 1

An unique identifier.


Departments

Departments Endpoints

POST https://collegecode.linways.com/api/v1/departments
RequestsCreate Department
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses

Create department
POST/departments

Creates a new department.


PUT https://collegecode.linways.com/api/v1/departments/

Update department
PUT/departments/


GET https://collegecode.linways.com/api/v1/departments
RequestsAll Departments
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 departments
GET/departments

List all departments.


GET https://collegecode.linways.com/api/v1/departments/
RequestsDepartment Details
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 ID
GET/departments/

Get Department Details By Id.


DELETE https://collegecode.linways.com/api/v1/departments/

Delete Department
DELETE/departments/


GET https://collegecode.linways.com/api/v1/departments/1/students
RequestsStudents in a department
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 department
GET/departments/{id}/students

Get Students Belonging To A Particular Department.

URI Parameters
HideShow
id
number (required) Example: 1

An unique identifier.


GET https://collegecode.linways.com/api/v1/departments/1/staffs
RequestsStaffs in a department
Headers
Accept: application/json
Authorization: API_ACCESS_TOKEN
Responses200
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 department
GET/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
URI Parameters
HideShow
id
number (required) Example: 1

An unique identifier.


Generated by aglio on 02 Nov 2021