Deleting Teacher Enrollment from a Course

Jump to solution
jlburville
Community Member

I'm trying to delete a teachers enrollment from many courses.  Nothing seems to be working.   Originally I was going to make two calls, one that selects all courses she is enrolled in and then I was going to filter it out to select all courses before a given data then I was going to use a second call in a loop to delete her from all those courses. 

The first call I'm going to use is: https://puc.instructure.com/api/v1/users/340026/enrollments?access_token="some access token"

Then I tried testing to delete it: https://puc.instructure.com/api/v1/courses/1352882/enrollments?id=340026&task=delete&access_token="s...

https://puc.instructure.com/api/v1/courses/1352882/enrollments/340026?task=delete&access_token="some...

when I try the above calls I always get a 404 not found error.

I also tried using a csv file which said it worked fine but the teacher is still in the course.

course_id,user_id,role,section_id,status

"MUED-371-01-14FA",0000254,teacher,,deleted

Help

1 Solution
tyler_clair
Community Champion

Hi James,

the id in the second api call should reference the enrollment id not the user id. So change it to this: https://puc.instructure.com/api/v1/courses/1352882/enrollments/{enrollment_id}?task=delete&access_token="some access token"

Best,

Tyler

View solution in original post