Skip to content

Doubtfire API

List of Doubtfire

API: Units - Group Sets

Units : Operations about Units

This markdown document provides detailed documentation for the “group_sets” API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl.

This “units” API page has the following operations.

  • DELETE /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{id}
  • POST /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{project_id}
  • GET /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members
  • DELETE /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}
  • PUT /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}
  • GET /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv
  • POST /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv
  • GET /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv
  • POST /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv
  • POST /api/units/{unit_id}/group_sets/{group_set_id}/groups
  • GET /api/units/{unit_id}/group_sets/{id}/groups
  • DELETE /api/units/{unit_id}/group_sets/{id}
  • PUT /api/units/{unit_id}/group_sets/{id}
  • POST /api/units/{unit_id}/group_sets

DELETE: Remove a group member

DELETE /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{id}

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{id}

  • Method: DELETE

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idThe unit idpathintegerYes
    group_set_idId of the group setpathintegerYes
    group_idid of the grouppathintegerYes
    idid of the memberpathintegerYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' 'http://localhost:3000/api/units/1/group_sets/2/groups/3/members/4'
  • Response Body:

    True

POST : Add a member to a group

POST /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{project_id}

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{project_id}
  • Method: POST
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
group_idid of the grouppathintegerYes
project_idproject id of the memberpathintegerYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X POST --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' 'http://localhost:3000/api/units/1/group_sets/2/groups/3/members/4'
  • Response Body:

    {
    "student_username": "TESTREQ",
    "id": 4,
    "student_first_name": "TEST",
    "student_last_name": "REQ",
    "student_nickname": "TEST1",
    "target_grade": "A"
    }

GET: Get the members of the group

GET /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members
  • Method: GET
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
group_idid of the grouppathintegerYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' 'http://localhost:3000/api/units/1/group_sets/2/groups/3/members'
  • Response Body:

    [
    {
    "student": "TESTREQ",
    "id": 4,
    "target_grade": "A"
    },
    {
    "student": "TEST2REQ2",
    "id": 5,
    "target_grade": "B"
    }
    ]

DELETE: Delete a group

DELETE /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}
  • Method: DELETE
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
group_idid of the grouppathintegerYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' 'http://localhost:3000/api/units/1/group_sets/2/groups/3'
  • Response Body:

    True

PUT: Update a group

PUT /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}
  • Method: PUT
  • Parameter:

Header

ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes

Path

ParameterDescriptionParameter TypeData TypeMandatory
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
group_idid of the grouppathintegerYes

Body(Group)

ParameterDescriptionParameter TypeData TypeMandatory
namename of the groupbodystringNo
tutorial_idtutorial id for the groupbodyintegerNo
capacity_adjustmenthow capacity for the group is adjustedbodyintegerNo
lockedIs the group lockedbodybooleanNo
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X PUT --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: Say13yA497H8wSFFXZxh' -d '{"name":"New Group Name","tutorial_id":2,"capacity_adjustment":3,"locked":true}' 'http://localhost:3000/api/units/1/group_sets/2/groups/3'
  • Response Body:

    {
    "id": 3,
    "name": "New Group Name",
    "tutorial_id": 2,
    "capacity_adjustment": 3,
    "locked": true
    }

GET:Download a CSV of students in groups within a group set

GET /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv
  • Method: GET
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET \--header 'Accept: application/octet-stream' \--header 'Username: aadmin' \--header 'Auth_Token: Say13yA497H8wSFFXZxh'\'http://localhost:3000/api/units/1/group_sets/2/groups/student_csv'
  • Response Body:

    (Binary CSV file download)

POST: Upload a CSV for students in groups within a group set

POST /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv
  • Method: POST
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
fileCSV file uploadbodyfileYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X POST \--header 'Accept: application/json' \ --header 'Username: aadmin' \ --header 'Auth_Token: Say13yA497H8wSFFXZxh' \--form 'file=@/path/to/file.csv' \'http://localhost:3000/api/units/1/group_sets/2/groups/student_csv'
  • Response Body:

{
"result": "Success"
}

GET: Download a CSV of groups within a group set

GET /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv
  • Method: GET
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET \--header 'Accept: application/octet-stream' \--header 'Username: aadmin' \--header 'Auth_Token: Say13yA497H8wSFFXZxh' \'http://localhost:3000/api/units/1/group_sets/2/groups/csv'
  • Response Body:

    (Binary CSV file download)

POST: Upload a CSV for groups within a group set

POST /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv
  • Method: POST
  • Parameter:
ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes
fileCSV file uploadbodyfileYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X POST \--header 'Accept: application/json' \--header 'Username: aadmin' \--header 'Auth_Token: Say13yA497H8wSFFXZxh' \--form 'file=@/path/to/file.csv' \'http://localhost:3000/api/units/1/group_sets/2/groups/csv'
  • Response Body:

{
"result": "Success"
}

POST: Add a new group to the group set

POST /api/units/{unit_id}/group_sets/{group_set_id}/groups

  • URL: /api/units/{unit_id}/group_sets/{group_set_id}/groups
  • Method: POST
  • Parameter:

Header

ParameterDescriptionParameter TypeData TypeMandatory
UsernameUsernameheaderstringYes
Auth_TokenAuthentication tokenheaderstringYes

Path

ParameterDescriptionParameter TypeData TypeMandatory
unit_idThe unit idpathintegerYes
group_set_idId of the group setpathintegerYes

Body(Group)

ParameterDescriptionParameter TypeData TypeMandatory
namename of the groupbodystringNo
tutorial_idtutorial id for the groupbodyintegerNo
capacity_adjustmenthow capacity for the group is adjustedbodyintegerNo
  • Response: 201 created

  • Example Request:

    Terminal window
    curl -X POST \--header 'Accept: application/json' \--header 'Username: aadmin' \--header 'Auth_Token: Say13yA497H8wSFFXZxh' \-d '{"name":"Group A","tutorial_id":1,"capacity_adjustment":0}' \'http://localhost:3000/api/units/1/group_sets/2/groups''
  • Response Body:

{
"group": {
"id": 3,
"name": "Group A",
"tutorial_id": 1,
"capacity_adjustment": 0
}
}

GET: Get the groups in a group set

GET /api/units/{unit_id}/group_sets/{id}/groups

  • URL: /api/units/{unit_id}/group_sets/{id}/groups

  • Method: GET

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUser UsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idpathintegerYes
    idpathintegerYes
  • Response: 200

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: sWkFmUyHxKDEN_9Qjxjj' 'http://localhost:3000/api/units/1/group_sets/3/groups'
  • Response Body:

    []

DELETE: Delete a group set

DELETE /api/units/{unit_id}/group_sets/{id}

  • URL: /api/units/{unit_id}/group_sets/{id}

  • Method: DELETE

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUser UsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idpathintegerYes
    idpathintegerYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 5tRKys7u_zJ3ZQ5a4tny' 'http://localhost:3000/api/units/1/group_sets/1'
  • Response Body:

    true

PUT: Edits the given group set

PUT /api/units/{unit_id}/group_sets/{id}

  • URL: /api/units/{unit_id}/group_sets/{id}

  • Method: PUT

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    idThe group set id to editpathintegerYes
    group_set[name]formDatastringYes
    group_set[allow_students_to_create_groups]Are students allowed to create groupsformDatabooleanNo
    group_set[allow_students_to_manage_groups]Are students allowed to manage their group membershipsformDatabooleanNo
    group_set[keep_groups_in_same_class]Must groups be kept in the one classformDatabooleanNo
    group_set[capacity]Capacity for each groupformDataintegerNo
    group_set[locked]Is this group set lockedformDatabooleanNo
    UsernameUser UsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idheaderintegerYes
  • Response: 200

  • Example Request:

    Terminal window
    curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 5tRKys7u_zJ3ZQ5a4tny' -d 'group_set%5Bname%5D=test_group_test&group_set%5Ballow_students_to_create_groups%5D=true&group_set%5Ballow_students_to_manage_groups%5D=true' 'http://localhost:3000/api/units/1/group_sets/1'
  • Response Body:

    {
    "id": 1,
    "name": "test_group_test",
    "allow_students_to_create_groups": true,
    "allow_students_to_manage_groups": true,
    "keep_groups_in_same_class": false,
    "capacity": null,
    "locked": false
    }

POST: Add a new group set to the given unit

POST /api/units/{unit_id}/group_sets

  • URL: /api/units/{unit_id}/group_sets

  • Method: POST

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idThe unit for the new group setpathintegerYes
    group_set[name]formDatastringYes
    group_set[allow_students_to_create_groups]Are students allowed to create groupsformDatabooleanNo
    group_set[allow_students_to_manage_groups]Are students allowed to manage their group membershipsformDatabooleanNo
    group_set[keep_groups_in_same_class]Must groups be kept in the one classformDatabooleanNo
    group_set[capacity]Capacity for each groupformDataintegerNo
    UsernameUser UsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 5tRKys7u_zJ3ZQ5a4tny' -d 'group_set%5Bname%5D=test_group&group_set%5Ballow_students_to_create_groups%5D=true' 'http://localhost:3000/api/units/1/group_sets'
  • Response Body:

    {
    "id": 1,
    "name": "test_group",
    "allow_students_to_create_groups": true,
    "allow_students_to_manage_groups": true,
    "keep_groups_in_same_class": false,
    "capacity": null,
    "locked": false
    }