Summary
The current Content Groups API v2 endpoint (/api/cohorts/v2/courses/{course_id}/group_configurations) returns an overly complex nested response structure that was designed for Studio's internal use. For the Instructor Dashboard, we need a simplified, flat response.
Current Response Structure
{
"all_group_configurations": [
{
"id": 18587404,
"name": "Content Groups",
"scheme": "cohort",
"groups": [
{"id": 1819362822, "name": "Content Group A", "version": 1, "usage": []},
{"id": 259161138, "name": "Test", "version": 1, "usage": []},
{"id": 205150518, "name": "Content Group B", "version": 1, "usage": []}
],
...
}
],
"context_course": null,
"course_outline_url": "...",
"group_configuration_url": "...",
"should_show_enrollment_track": false,
"should_show_experiment_groups": true
}
Desired Response Structure
{
"id": 18587404,
"groups": [
{"id": 1819362822, "name": "Content Group A", "version": 1, "usage": []},
{"id": 259161138, "name": "Test", "version": 1, "usage": []},
{"id": 205150518, "name": "Content Group B", "version": 1, "usage": []}
],
"studio_content_groups_link": "http://example-host.com/authoring/course/course-v1:org+course+run/group_configurations"
}
Requirements
- Return a flat
groups array containing just the content groups for the course
- Include
studio_content_groups_link - a URL to Studio where instructors can create/manage content groups
- Always return both fields, even when
groups is an empty array (so users can navigate to Studio to create their first content group)
Acceptance Criteria
- API returns only
groups and studio_content_groups_link fields
groups is a flat array of content group objects
studio_content_groups_link points to Studio's group configurations page
- Response works correctly when no content groups exist (empty array)
- Update serializers and views accordingly
- Update API tests
Summary
The current Content Groups API v2 endpoint (/api/cohorts/v2/courses/{course_id}/group_configurations) returns an overly complex nested response structure that was designed for Studio's internal use. For the Instructor Dashboard, we need a simplified, flat response.
Current Response Structure
{ "all_group_configurations": [ { "id": 18587404, "name": "Content Groups", "scheme": "cohort", "groups": [ {"id": 1819362822, "name": "Content Group A", "version": 1, "usage": []}, {"id": 259161138, "name": "Test", "version": 1, "usage": []}, {"id": 205150518, "name": "Content Group B", "version": 1, "usage": []} ], ... } ], "context_course": null, "course_outline_url": "...", "group_configuration_url": "...", "should_show_enrollment_track": false, "should_show_experiment_groups": true }Desired Response Structure
{ "id": 18587404, "groups": [ {"id": 1819362822, "name": "Content Group A", "version": 1, "usage": []}, {"id": 259161138, "name": "Test", "version": 1, "usage": []}, {"id": 205150518, "name": "Content Group B", "version": 1, "usage": []} ], "studio_content_groups_link": "http://example-host.com/authoring/course/course-v1:org+course+run/group_configurations" }Requirements
groupsarray containing just the content groups for the coursestudio_content_groups_link- a URL to Studio where instructors can create/manage content groupsgroupsis an empty array (so users can navigate to Studio to create their first content group)Acceptance Criteria
groupsandstudio_content_groups_linkfieldsgroupsis a flat array of content group objectsstudio_content_groups_linkpoints to Studio's group configurations page