How to download a course roster with group membership

Jump to solution
baldus
Community Novice

Hi everyone,

I'm looking for a way to download the course roster with group membership identified for each student (e.g., a column in the spreadsheet that contains the group number/name).  I have heard that this data can be pulled through the API and I was wondering if anyone could help me find out how that is possible.  Any suggestions?

Thanks in advance for your help!

1 Solution
gtaylor
Community Contributor

Using the API to do this would work like this:

The groups piece would be 2 calls.

List the groups available in a context.

GET /api/v1/courses/:course_id/groups

This will give you a list of groups for a course.

Then you plug in the ID to get the Group Memeber ship.

List Group membership

GET /api/v1/groups/:group_id/memberships

{Needs a group ID}

Get the list of enrollments for the course.

GET /api/v1/courses/:course_id/enrollments

Then you could compare the enrollments list to the membership list.

Attached is a Windows Powershell script to do that.

It only gives student name and group name to a csv file.

View solution in original post