Skip to content
Ayush Agarwal edited this page Apr 2, 2015 · 31 revisions

This is the API v2 Reference. For the Legacy API Reference, check here.

Data is to be accessed through HTTP POST Requests to https://vitacademics-rel.herokuapp.com/
All data is received as JSON.

###Usage All requests to the API are HTTP POST Requests unless specified.

#####System API

This is a HTTP GET Request.

$ curl https://vitacademics-rel.herokuapp.com/api/v2/system

#####Logging In The user has to first to login through the following Request:

$ curl --data "regno=<reg-number>&dob=<dob>" https://vitacademics-rel.herokuapp.com/api/v2/<campus>/login

where:

  • reg-number is to be replaced with your registration number (case insensitive)

  • dob is to be replaced with your date of birth (eg. 12051994)

  • campus can have the values (case sensitive):

    • vellore
    • chennai

#####Fetching/Refreshing Data

The data can be fetched (for the first time) or refreshed by the usage of the following request:

$ curl --data "regno=<reg-number>&dob=<dob>" https://vitacademics-rel.herokuapp.com/api/v2/<campus>/refresh

where the values for reg-number, dob, campus are the same as above.

#####Token

The token to share the timetable with a friend can be obtained by the following:

$ curl --data "regno=<reg-number>&dob=<dob>" https://vitacademics-rel.herokuapp.com/api/v2/<campus>/token

#####Share

The token obtained from above can be used to share timetable data who's credentials were used above to generate the token:

$ curl --data "token=<token>" https://vitacademics-rel.herokuapp.com/api/v2/<campus>/share

Sharing can be done directly through:

$ curl --data "regno=<reg-number>&dob=<dob>&receiver=<receiver-reg-number>" https://vitacademics-rel.herokuapp.com/api/v2/<campus>/share

This returns the timetable of the person who's credentials were given.

#####Grades

The academic history and grades can be obtained by the following:

$ curl --data "regno=<reg-number>&dob=<dob>" https://vitacademics-rel.herokuapp.com/api/v2/<campus>/grades

###Return Values

A successful login returns a JSON object like the following:

{"reg_no":"<reg-number>","dob":"<dob>","campus":"<campus>","status":{"message":"Successful Execution","code":0}}

A successful refresh would return a JSON having the Time Table, Course Data, Attendance, Marks for the user in the format:

{
    reg_no:<reg-no>,
    dob: <dob>,
    campus: <campus>,
    timetable: {day:[list of class numbers (0s for gaps)]},
    courses: [{ all courses in a list with all details (faculty name, timings, attendance, marks}],
    semster: <semester-type>,
    refreshed: <timestamp>
    withdrawn_courses: []
}

A successful token generation would return the token in a JSON:

{"reg_no":<reg-number>, "dob":<dob>, "campus":<campus>, "share":{"token":"ABC123","validity":24,"issued":"<timestamp>"},"status":{"message":"Successful Execution","code":0}}

A share request returns the timetable in JSON.

A grades request returns the academic history in the following format:

{
   reg_no: <reg-no>,
   dob: <dob>,
   campus: <campus>,
   grades: [ List of All Courses Passed:
                {
                    course_code:
                    course_title:
                    course_type:
                    credits:
                    grade:
                    exam_held:
                    result_date:
                    option:
                }
            ]
    semester_wise: { List of Semesters - "examYear-examMonth" : { credits: , gpa: }}
    credits_registered: 
    credits_earned:
    cgpa:
    grade_summary: {"gradeValue": Number of Times Scored }
    grades_refreshed:
    cached:
    status:
}

A system request returns the details regarding the latest and supported versions of the Client Apps on iOS, Android and Windows Platforms in the following format:

{
    "platform" : {"latest": , "supported": }
    "messages": []
    "status": {}
}

Any erroneous response can be checked using the status code returned:

  • 0: Success
  • 11: Session Timed Out
  • 12: Invalid Credentials
  • 13: Error Parsing the Captcha
  • 14: Token Expired
  • 15: Requested Data Unavailable
  • 16: Error Parsing Data / Invalid Credentials
  • 50: Feature Incomplete
  • 89: VIT servers are down / Connectivity Issue
  • 97: MongoLab Issue / Connectivity Issue
  • 98: Down for Maintenance
  • 99: Unforeseen Error

###Key Legends: Course Type is present in a key called "course_type". It has the following values:

  • CBL Course: 1
  • LBC Course: 2
  • PBL Course: 3
  • RBL Course: 4
  • PBC Course with specific information (like Project Title, Guide): 5
  • PBC Course with no such information: 6
  • Unsupported Course Type: 0

Marks Type is present in a key called "marks_type". It has the following values:

  • CBL Type: 1
  • LBC Type: 2
  • PBC Type: 3
  • PBL/RBL Type: 4
  • Unsupported Marks Type: 0

Any issues, bugs or features you would like to be added can be reported here.

Clone this wiki locally