cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Surveyor

Issues with members field when editing group

Jump to solution

Hi!  I'm attempting to use the Canvas API to create and populate groups within a particular group set.  I'm using a colleague's Python Canvas API wrapper script (that uses the requests package) that I am relatively familiar with and confident in and can provide relevant snippets of code if that would be useful.

At this point, I can create a group in the desired group set, but when I go to edit/add the members, only the last entry in the list/array I pass gets added.  I was wondering if anyone had experienced something similar and had ideas about debugging.  My API call through the wrapper looks like:

group = canvas.put(f'/groups/{gid}', {'members': ['3695571', '3938570', '3795023']})

Internally, this sets up the Canvas API PUT call to /api/v1/groups/{gid} with the form parameter members.   This successfully modifies the specified group (determined by gid), but the group ends up with only the last student (here 3795023).  I've rotated my list of student IDs to confirm that it's the last one that always gets added.

Labels (2)
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Surveyor

Solved:  The API actually needs the full parameter name 'members[]'...

View solution in original post

0 Kudos
2 Replies
Highlighted
Surveyor II

Have you tried passing the IDs as a string?

0 Kudos
Highlighted
Surveyor

Solved:  The API actually needs the full parameter name 'members[]'...

View solution in original post

0 Kudos