Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Description

userId

The ID of the timetable

timetableId

The ID of the timetable

...

GROUPS

...

/api/group/:id

Request type:

...

GET

Description

Create a new group.

...

Get the information of a group given a group ID.

Code

Format

201

200

Code Block
languagejson
{
    "status": Success message for creation of group.
    "data": {
      "id": The id of the group created.
      "name": The name of the group created.
      "visibility": The group visibility, the default is private groups.
      "timetableIDs": The list of all the selected timetables for users in the group.
      "memberIDs": The list of all members in the group.
      "groupAdmins": The list of all the group admins.
    }
}

404

Code Block
{
languagejson
{
 
"statusCode":
 
404.
  
"timestamp": An ISOString format timestamp of when error encountered.
    "path": The url path that cause this error to occur.
    "data": 
Message
Can't 
detailing what went wrong. eg "Timetable Not found!" or "User Not found!".
find group!.
}

Path Parameters

Name

Description

id

The ID of the group.

/api/group

Request type: POST

Description

Create a new group.

Result

Code

Format

200

Code Block
languagejson
{
    "status": Success message for creation of group.
    "data": {
      "id": The id of the group created.
      "name": The name of the group created.
      "visibility": The group visibility, the default is private groups.
      "timetableIDs": The list of all the selected timetables for users in the group.
      "memberIDs": The list of all members in the group.
      "groupAdmins": The list of all the group admins.
    }
}

201

Code Block
languagejson
{
    "status": Group with that ID already exists!
    "data": {
      "id": The id of the group created.
      "name": The name of the group created.
      "visibility": The group visibility, the default is private groups.
      "timetableIDs": The list of all the selected timetables for users in the group.
      "memberIDs": The list of all members in the group.
      "groupAdmins": The list of all the group admins.
    }
}

400

Code Block
{
    "timestamp": An ISOString format timestamp of when error encountered.
    "path": The url path that cause this error to occur.
    "data": Message detailing what went wrong.
}

Body Parameters

Name

Description

groupData

Code Block
languagejson
{
  "name": The name of the group.
  "visibility": The group visibility, the default is private groups.
  "timetableIDs": The list of all the selected timetables for users in the group.
  "memberIDs": The list of all members in the group.
  "groupAdmins": The list of all the group admins.
}

groupID

The ID of the group.

/api/group

Request type: PUT

Description

Updates the information of a group given a group ID.

Result

Code

Format

200

Code Block
languagejson
{
    "status": Success message for updating of group.
    "data": {
      "id": The id of the group created.
      "name": The name of the group created.
      "visibility": The group visibility, the default is private groups.
      "timetableIDs": The list of all the selected timetables for users in the group.
      "memberIDs": The list of all members in the group.
      "groupAdmins": The list of all the group admins.
    }
}

201

Code Block
languagejson
{
    "status": Group created!
    "data": {
      "id": The id of the group created.
      "name": The name of the group created.
      "visibility": The group visibility, the default is private groups.
      "timetableIDs": The list of all the selected timetables for users in the group.
      "memberIDs": The list of all members in the group.
      "groupAdmins": The list of all the group admins.
    }
}

409

Code Block
{
    "timestamp": An ISOString format timestamp of when error encountered.
    "path": The url path that cause this error to occur.
    "data": Message detailing what went wrong. ie already exists
}

Body Parameters

Name

Description

adminUserID

The ID of the admin wishing to make changes.

groupData

Code Block
languagejson
{
  "name": The name of the group.
  "visibility": The group visibility, the default is private groups.
  "timetableIDs": The list of all the selected timetables for users in the group.
  "memberIDs": The list of all members in the group.
  "groupAdmins": The list of all the group admins.
}

groupID

The ID of the group.

/api/group

Request type: DELETE

Description

Delete a group given the group ID.

Result

Code

Format

204

Code Block
languagejson
{
    "status": Success message for deletion of group.
    "data": {}
}

404

Code Block
{
    "timestamp": An ISOString format timestamp of when error encountered.
    "path": The url path that cause this error to occur.
    "data": Message detailing what went wrong. ie Not Found, 
            Or user is not authorized for the action.
}

Body Parameters

Name

Description

adminUserID

userID

The ID of the

creator of the group

user wishing to delete group.

groupID

The ID of the

timetable

group.