Jta26 / Pitt-Office-Hour-Scheduler

Office Hour Scheduler
0 stars 0 forks source link

Create mini-API #2

Open Jta26 opened 3 years ago

Jta26 commented 3 years ago
  1. GET office hours with availability

    
    {
    [
       {
    
    "time": 'timestamp'
    "available": false
    "annotations": "The office hours did well for this student"
    
    } ,
       {
          "time": 'timestamp'
          "available": false
          "annotations": "The office hours did well for this student"
      } ,
    ]

}



2. POST fill office hour timeslot

3. GET Student list for a given course.

4. GET course list (all courses by name and number)

tentative to adding more as needed
PatHealy commented 3 years ago

Further notes on data format...

Courses will be saved in "courses.json", which will look something like this:

[
    {
    "title": "Data Structures",
    "course_code": "CS 0045",
    "term": "2214",
    "students": ["Joel Austin", "Kacey Hirth", "Jose Zindia", "Pat Healy", "Brenna Schroter"]
    }
]
PatHealy commented 3 years ago

For reference, here's an example url for getting the students for a given course: host/data/students.php?title=Data%20Structures&course_code=CS%200045&term_code=2214

PatHealy commented 3 years ago

url for getting the list of courses is host/data/courses.php

PatHealy commented 3 years ago

Get office hour availability by issuing a get request to host/data/schedule.php

Post fill an office hour timeslot by issuing a post request to host/data/schedule.php with these two parameters:

The post will fail if either the slot wasn't available or the student is not registered with any courses (according to courses.json). It returns detailed error messages in both of these cases.

All of the above code is on the data-api branch, waiting to be merged to master