Skip to content

Latest commit

 

History

History
157 lines (114 loc) · 10.1 KB

Endpoints.md

File metadata and controls

157 lines (114 loc) · 10.1 KB

Endpoint Guide

Run in Postman

Important Notes!

For endpoints that contain a {param}, the Parameters column lists paramInURL: correspondingModelAttribute. If a corresponding model attribute isn't listed, that means the parameter and attribute share the same name.
For example, 'cohort: adjustedGradDate' means that {cohort} corresponds to the attribute adjustedGradDate. Alternatively, if only 'firstName' is listed, that means {firstName} corresponds to the attribute firstName.

Table of Contents

  1. About Query Endpoints
  2. Student Endpoints
  3. Course Endpoints
  4. Exam Endpoints
  5. StudentExam Endpoints
  6. StudentCourse Endpoints
  7. Note Endpoints

About Query Endpoints

Back to Table of Contents

All query endpoints are the pluralized model name followed by '?' (ie. /objects?).
Parameters are assigned values using the syntax 'paramName=paramValue'.
Parameters are strung together using '&'.

Basic Query with And

/objects?param1=foo&param2=bar&param3=1234
Returns all objects where param1 is foo, param2 is bar, and param3 is 1234.

Query with Or

/objects?param1=optionOne&param1=optionTwo
Returns all objects where param1 is optionOne or optionTwo.

Query with Min/Max

/objects?param=50
Returns all objects where param is equal to 50.

/objects?param=50&param=50
Returns all objects where param is equal to 50.

/objects?param=50&param=70
Returns all objects where param is between 50 and 70, inclusive.

If a parameter can be queried with min and max, it will be listed next to the parameter name in the tables below, for example: gpa (min/max).

About String Queries

String queries are case-sensitive at the moment.

There are a few different ways that string queries may be treated:

  • Exact match: returns objects where string exactly matches given string
  • Starts with: returns objects where string starts with the given string
  • Substring: returns objects where string contains the given string

If the query checks for starts with or substring, it will be listed next to the parameter name in the tables below, for example: firstName (startsWith), or courseName (substring). If nothing is listed next to a parameter name, this means the query will check for an exact match.

Student Endpoints

Back to Table of Contents

_Note: Both _start and _end need to be set if either are to be used in GET /students? and will return _start - _end number of students. Also, name_like will query against the firstName and lastName columns.
Type URL Description Returns Parameters
GET .../students? Get all students that match the query parameters Array<Student>
  • id
  • firstName (substring)
  • lastName (substring)
  • entryDate
  • entryType
  • originalGradDate
  • gradDate
  • status
  • gpa (min/max)
  • preferredName
  • gradDateChanges
  • entryType
  • hasVisa
  • isDualDegree
  • leftProgram
  • _start (int)
  • _end (int)
  • _order (ASC/DESC)
  • _sort (id/firstName/lastName/status/gpa/cohort)
  • name_like (string)
  • id_like (string)
GET .../students/ Get all students Array<Student>
GET .../students/{id} Get student with given NUID Student
  • id
GET .../students/{id}/courses Get all of a student's courses Array<Course>
  • id
GET .../students/{studentId}/courses/{courseId} Get a student's instance of a course StudentCourse
  • studentId: id
  • courseId
GET .../students/{studentId}/courses/{courseID}/exams Get all student's exam instances from a course Array<StudentExam>
  • studentId: id
  • courseId
GET .../students/{id}/exams Get all of a student's exams Array<Exam>
  • id
GET .../students/{studentId}/exams/{examId} Get a student's instance of an exam StudentExam
  • studentId: id
  • examId
GET .../students/{id}/notes Get all of a student's notes Array<Note>
  • id
POST .../students/ Create a new student
PUT .../students/{id} Update student with given NUID
  • id
PATCH .../students/{id} Update student with given NUID
  • id
DELETE .../students/{id} Delete student with given NUID
  • id

Course Endpoints

Back to Table of Contents

Note: Both _start and _end need to be set if either are to be used in GET /courses? and will return _start - _end number of courses.
Type URL Description Returns Parameters
GET .../courses? Get all courses that match the query parameters
  • id
  • name (substring)
  • subject (substring)
  • number (min/max)
  • _start (int)
  • _end (int)
  • _order (ASC/DESC)
  • _sort (subject/number/name)
  • name_like (string)
GET .../courses/ Get all courses
GET .../courses/{id} Get course with the given ID Course
  • id
POST .../courses/ Create a course
PUT .../courses/{id} Update course with the given course id
  • id
PATCH .../courses/{id} Update course with the given course id
  • id
DELETE .../courses/{id} Delete course with the given course id
  • id

Exam Endpoints

Back to Table of Contents

Type URL Description Returns Parameters
GET .../exam? Get all exams that match the query parameters Array<Exam>
  • id
  • name (substring)
GET .../exams/ Get all exams Array<Exam>
GET .../exams/{id} Get exam with the given exam id Exam
  • id
GET .../exams/{id}/instances Get all instances of an Exam given an exam id Array<StudentExam>
  • id
POST .../exams/ Create an exam
PUT .../exams/{id} Update an exam given an exam id
  • id
PATCH .../exams/{id} Update an exam given an exam id
  • id
DELETE .../exams/{id} Delete an exam given an exam id
  • id

StudentExam Endpoints

Back to Table of Contents

Type URL Description Returns Parameters
GET .../studentExams? Get all studentExam instances that match the query parameters Array<StudentExam>
  • id
  • student
  • exam
  • letterGrade
  • semester
  • year (min/max)
  • percentage (min/max)
GET .../studentExams/ Get all studentExam instances Array<StudentExam>
GET .../studentExams/{id} Get a studentExam instance given a studentExam id StudentExam
  • id
POST .../studentExams/ Create a studentExam instance
PUT .../studentExams/{id} Update a studentExam instance given a studentExam id
  • id
PATCH .../studentExams/{id} Update a studentExam instance given a studentExam id
  • id
DELETE .../studentExams/{id} Delete a studentExam instance given a studentExam id
  • id

StudentCourse Endpoints

Back to Table of Contents

Type URL Description Returns Parameters
GET .../studentCourses? Get all studentCourse instances that match the given parameters Array<StudentCourse>
  • id
  • student
  • course
  • percentage (min/max)
  • letterGrade
  • semester
  • year (min/max)
GET .../studentCourses/ Get all studentCourse instances Array<StudentCourse>
GET .../studentCourses/{id} Get a studentCourse instance given a studentCourse id StudentCourse
  • id
POST .../studentCourses/ Create a studetnCourse instance
PUT .../studentCourses/{id} Update a studentCourse instance given a studentCourse id
  • id
PATCH .../studentCourses/{id} Update a studentCourse instance given a studentCourse id
  • id
DELETE .../studentCourses/{id} Delete a studentCourse instance given the studentCourse id
  • id

Note Endpoints

Back to Table of Contents

Type URL Description Returns Parameters
GET .../notes? Get all note instances that match the given parameters Array<Note>
  • id
  • title (substring)
  • body (substring)
  • tags (substring)
  • date (min/max, ISO format)
GET .../notes/ Get all notes Array<Note>
GET .../notes/{id} Get a note with the given note id Note
  • id
POST .../notes/ Create a note
PUT .../notes/{id} Update a note given a note id
  • id
PATCH .../notes/{id} Update a note given a note id
  • id
DELETE .../notes/{id} Delete a note given a note id
  • id