Back to main
Add Class
Remove Class
Add User To Class
Remove User From Class
Get All Users From Class
Get All Chairs From Class
Get All Classes
Assign Teacher To Class
Back to the top
{
"body" : {
"teacher_username" : " RS600499" ,
"class_name" : " Test Class" ,
"hour" : 4 ,
"room_id" : 4
},
"action" : " add_class"
}
Variable
Data Type
Required
Additional Validation
teacher_username
string
True
Must be a username ascribed to a teacher
class_name
string
True
No
hour
integer
True
Teacher must not have other class at this hour
room_id
integer
True
Room must not have a class taught in it at this hour
{
"message" : " Class added"
}
{
"error" : " error message"
}
Back to the top
?class_id=7&action=remove_class
Variable
Data Type
Required
Additional Validation
class_id
integer
True
No
{
"message" : " Class Removed"
}
{
"error" : " error message"
}
Back to the top
Expected Request ?class_id=1&action=get_all_users_from_class
Variable
Data Type
Required
Additional Validation
class_id
integer
True
No
{
"message" : " array of user information for that class"
}
{
"error" : " error message"
}
Back to the top
{
"body" : {
"class_id" : 21 ,
"user_id" : 71
},
"action" : " add_user_to_class"
}
Variable
Data Type
Required
Additional Validation
class_id
integer
True
No
user_id
integer
True
No
{
"message" : " User has been added to that class"
}
{
"error" : " error message"
}
Back to the top
?class_id=2&user_id=244&action=remove_user_from_class
Variable
Data Type
Required
Additional Validation
class_id
integer
True
No
user_id
integer
True
No
{
"message" : " User has been added to that class"
}
{
"error" : " error message"
}
Get All Chairs From Class
Back to the top
Expected Request ?class_id=1&action=get_all_chairs_from_class
Variable
Data Type
Required
Additional Validation
class_id
integer
True
No
{
"message" : " array with all chairs in the provided class"
}
{
"error" : " error message"
}
Back to the top
Expected Request /api/class/?action=get_all_classes
Variable
Data Type
Required
Additional Validation
{
"message" : " array of all classes"
}
{
"error" : " error message"
}
Back to the top
{
"body" : {
"class_id" : 3 ,
"teacher_id" : 2
},
"action" : " assign_teacher_to_class"
}
Variable
Data Type
Required
Additional Validation
class_id
integer
True
No
teacher_id
integer
True
No
{
"message" : " teacher has been assigned to that class"
}
{
"error" : " error message"
}