Issues with members field when editing group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Solved: The API actually needs the full parameter name 'members[]'...