Group Categories
Group Categories allow grouping of groups together in canvas. There are a few different built-in group categories used, or custom ones can be created. The built in group categories are: "communities", "student_organized", and "imported".
A GroupCategory object looks like:
GroupCategoriesController#index
GET /api/v1/accounts/:account_id/group_categories
GET /api/v1/accounts/:account_id/group_categories
Scope: url:GET|/api/v1/accounts/:account_id/group_categories
GET /api/v1/courses/:course_id/group_categories
GET /api/v1/courses/:course_id/group_categories
Scope: url:GET|/api/v1/courses/:course_id/group_categories
Returns a paginated list of group categories in a context. The list returned depends on the permissions of the current user. If the user has group management permissions (‘GRANULAR_MANAGE_GROUPS_PERMISSIONS`), the response will include only collaborative group categories. If the user has tag management permissions (`GRANULAR_MANAGE_TAGS_PERMISSIONS`), the response will include only non-collaborative group categories.
Example Request:
Returns a list of GroupCategory objects.
GroupCategoriesController#show
GET /api/v1/group_categories/:group_category_id
GET /api/v1/group_categories/:group_category_id
Scope: url:GET|/api/v1/group_categories/:group_category_id
Returns the data for a single group category, or a 401 if the caller doesn’t have the rights to see it.
Example Request:
Returns a GroupCategory object.
GroupCategoriesController#create
POST /api/v1/accounts/:account_id/group_categories
POST /api/v1/accounts/:account_id/group_categories
Scope: url:POST|/api/v1/accounts/:account_id/group_categories
POST /api/v1/courses/:course_id/group_categories
POST /api/v1/courses/:course_id/group_categories
Scope: url:POST|/api/v1/courses/:course_id/group_categories
Create a new group category
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | Name of the group category |
|
| Allow students to sign up for a group themselves (Course Only). valid values are:
Allowed values: |
|
| Assigns group leaders automatically when generating and allocating students to groups Valid values are:
Allowed values: |
|
| Limit the maximum number of users in each group (Course Only). Requires self signup. |
|
| The unique SIS identifier. |
|
| Create this number of groups (Course Only). |
|
| (Deprecated) Create this number of groups, and evenly distribute students among them. not allowed with “enable_self_signup”. because the group assignment happens synchronously, it’s recommended that you instead use the assign_unassigned_members endpoint. (Course Only) |
Example Request:
Returns a GroupCategory object.
GroupCategoriesController#import
POST /api/v1/group_categories/:group_category_id/import
POST /api/v1/group_categories/:group_category_id/import
Scope: url:POST|/api/v1/group_categories/:group_category_id/import
Create Groups in a Group Category through a CSV import
For more information on the format that’s expected here, please see the “Group Category CSV” section in the API docs.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| There are two ways to post group category import data - either via a multipart/form-data form-field-style attachment, or via a non-multipart raw post request.
‘attachment’ is required for multipart/form-data style posts. Assumed to be outcome data from a file upload form field named ‘attachment’.
Examples:
If you decide to do a raw post, you can skip the ‘attachment’ argument, but you will then be required to provide a suitable Content-Type header. You are encouraged to also provide the ‘extension’ argument.
Examples:
|
Example Response:
Returns a Progress object.
GroupCategoriesController#update
PUT /api/v1/group_categories/:group_category_id
PUT /api/v1/group_categories/:group_category_id
Scope: url:PUT|/api/v1/group_categories/:group_category_id
Modifies an existing group category.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Name of the group category |
|
| Allow students to sign up for a group themselves (Course Only). Valid values are:
Allowed values: |
|
| Assigns group leaders automatically when generating and allocating students to groups Valid values are:
Allowed values: |
|
| Limit the maximum number of users in each group (Course Only). Requires self signup. |
|
| The unique SIS identifier. |
|
| Create this number of groups (Course Only). |
|
| (Deprecated) Create this number of groups, and evenly distribute students among them. not allowed with “enable_self_signup”. because the group assignment happens synchronously, it’s recommended that you instead use the assign_unassigned_members endpoint. (Course Only) |
Example Request:
Returns a GroupCategory object.
GroupCategoriesController#destroy
DELETE /api/v1/group_categories/:group_category_id
DELETE /api/v1/group_categories/:group_category_id
Scope: url:DELETE|/api/v1/group_categories/:group_category_id
Deletes a group category and all groups under it. Protected group categories can not be deleted, i.e. “communities” and “student_organized”.
Example Request:
GroupCategoriesController#groups
GET /api/v1/group_categories/:group_category_id/groups
GET /api/v1/group_categories/:group_category_id/groups
Scope: url:GET|/api/v1/group_categories/:group_category_id/groups
Returns a paginated list of groups in a group category
Example Request:
Returns a list of Group objects.
GroupCategoriesController#export
BETA: This API endpoint is not finalized, and there could be breaking changes before its final release.
GET /api/v1/group_categories/:group_category_id/export
GET /api/v1/group_categories/:group_category_id/export
Scope: url:GET|/api/v1/group_categories/:group_category_id/export
Returns a csv file of users in format ready to import.
Example Request:
GroupCategoriesController#users
GET /api/v1/group_categories/:group_category_id/users
GET /api/v1/group_categories/:group_category_id/users
Scope: url:GET|/api/v1/group_categories/:group_category_id/users
Returns a paginated list of users in the group category.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The partial name or full ID of the users to match and return in the results list. Must be at least 3 characters. |
|
| Set this value to true if you wish only to search unassigned users in the group category. |
Example Request:
Returns a list of User objects.
GroupCategoriesController#assign_unassigned_members
POST /api/v1/group_categories/:group_category_id/assign_unassigned_members
POST /api/v1/group_categories/:group_category_id/assign_unassigned_members
Scope: url:POST|/api/v1/group_categories/:group_category_id/assign_unassigned_members
Assign all unassigned members as evenly as possible among the existing student groups.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The assigning is done asynchronously by default. If you would like to override this and have the assigning done synchronously, set this value to true. |
Example Request:
Example Response:
© Instructure, Inc. Generated on Wed Nov 6 14:20:07 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated