Skip to content

RESTful API Documentation

matthewkourlas edited this page Mar 1, 2019 · 26 revisions

Root

Visiting this link will show the routes that can be accessed to get all students, all employers, etc.

  • Route: https://ecse321-group17.herokuapp.com/

GET Routes

Get Student

Returns a single student with the specified email.

  • Route: https://ecse321-group17.herokuapp.com/student/{email}
  • Example: https://ecse321-group17.herokuapp.com/student/student@mail.mcgill.ca

Get Employer

Returns a single employer with the specified email.

  • Route: https://ecse321-group17.herokuapp.com/employer/{email}
  • Example: https://ecse321-group17.herokuapp.com/employer/employer@company.ca

Get Co-op Administrator

Returns a single administrator with the specified email.

  • Route: https://ecse321-group17.herokuapp.com/admin/{email}
  • Example: https://ecse321-group17.herokuapp.com/admin/admin@mcgill.ca

Get Co-op Term

Returns a single co-op term with the specified ID.

  • Route: https://ecse321-group17.herokuapp.com/coop/{id}
  • Example: https://ecse321-group17.herokuapp.com/coop/12345

Get All Students

Returns all students in the database.

  • Route: https://ecse321-group17.herokuapp.com/students

Get All Employers

Returns all employers in the database.

  • Route: https://ecse321-group17.herokuapp.com/employers

Get All Co-op Administrators

Returns all co-op administrators in the database.

  • Route: https://ecse321-group17.herokuapp.com/admins

Get All Co-op Terms

Returns all co-op terms in the database.

  • Route: https://ecse321-group17.herokuapp.com/coops

Get Co-op Progress

Returns the status, start and end dates, and all report information for the specified co-op.

  • Route: https://ecse321-group17.herokuapp.com/progress/coop/{id}
  • Example: https://ecse321-group17.herokuapp.com/progress/coop/12345

Get Co-op Statistics

Returns relevant statistics for co-op terms that can be filtered by a specified range and co-op number, i.e. a co-op number of 2 would return the 2nd co-op terms of all students. StartTerm and EndTerm must be of the form Winter2019.

  • Route: https://ecse321-group17.herokuapp.com/statistics/coop/{startTerm}/{endTerm}/{coopNumber}
  • Example: https://ecse321-group17.herokuapp.com/statistics/coop/Summer2018/Summer2019/1

Get Report Statistics

Returns relevant report statistics for co-op terms that can be filtered by a specified range and co-op number, i.e. a co-op number of 2 would return the 2nd co-op terms of all students. StartTerm and EndTerm must be of the form Winter2019.

  • Route: https://ecse321-group17.herokuapp.com/statistics/report/{startTerm}/{endTerm}/{coopNumber}
  • Example: https://ecse321-group17.herokuapp.com/statistics/report/Winter2018/Winter2019/2

Get All Reports For A Specific Student

Returns all reports across all co-ops done by the specified student.

  • Route: https://ecse321-group17.herokuapp.com/reports/student/{email}
  • Example: https://ecse321-group17.herokuapp.com/reports/student/student@mail.mcgill.ca

Get All Reports For A Specific Coop

Returns all reports submitted for the specified co-op.

  • Route: https://ecse321-group17.herokuapp.com/reports/coop/{id}
  • Example: https://ecse321-group17.herokuapp.com/reports/coop/12345

POST Routes

Create Student

Creates a new student in the database. First and last name must be separated by an underscore.

  • Route: https://ecse321-group17.herokuapp.com/student/create/{email}/{password}/{name}/{phone}/{studentId}
  • Example: https://ecse321-group17.herokuapp.com/student/create/student@mail.mcgill.ca/pw/Albert_Kragl/6041231231/260722322

Create Employer

Creates a new employer in the database. First and last name must be separated by an underscore.

  • Route: https://ecse321-group17.herokuapp.com/employer/create/{email}/{password}/{name}/{phone}/{emplId}
  • Example: https://ecse321-group17.herokuapp.com/employer/create/employer@company.ca/pw/Employer_Person/6041231233/123

Create Co-op Administrator

Creates a new co-op administrator in the database. First and last name must be separated by an underscore.

  • Route: https://ecse321-group17.herokuapp.com/admin/create/{email}/{password}/{name}/{phone}/{adminId}
  • Example: https://ecse321-group17.herokuapp.com/admin/create/admin@mcgill.ca/pw/Admin_Person/6041231232/321

Create Co-op

Creates a new co-op term in the database. Words in the co-op title and in the address must be separated by underscore. Dates must be formatted as yyyy-mm-dd.

  • Route: https://ecse321-group17.herokuapp.com/coop/create/{id}/{title}/{stuEmail}/{empEmail}/{start}/{end}/{status}/{salaryPerHour}/{hoursPerWeek}/{address}
  • Example: https://ecse321-group17.herokuapp.com/coop/create/1/Software_Intern/student@mail.mcgill.ca/employer@company.ca/2019-05-20/2019-08-09/NotStarted/20/40/Montreal

Create Notification

Creates a new notification object in the database. Words in the notification message must be separated by underscore.

  • Route: https://ecse321-group17.herokuapp.com/notification/create/{id}/{text}/{senderEmail}/{stuEmail}/{empEmail}
  • Example: https://ecse321-group17.herokuapp.com/notification/create/1/Hello_World/admin@mcgill.ca/student@mail.mcgill.ca/employer@company.ca

Create Report

Creates a new report object in the database. The date must be formatted as yyyy-mm-dd.

Status refers to Report Status, which can have the following values:

Unsubmitted, Submitted, Late, Reviewed

Type refers to Report Type, which can have the following values:

Contract, Technical, StudentEval, EmployerEval, TwoWeek

  • Route: https://ecse321-group17.herokuapp.com/report/create/{id}/{coopID}/{date}/{status}/{type}
  • Example: https://ecse321-group17.herokuapp.com/report/create/1/123/2019-02-29/Late/Contract