API - Set a students enrollment to 'inactive'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm attempting to 'drop' students from courses through the Canvas API. Currently when I run my drop php code the student is marked as 'Completed' but I would like to set the student as 'Inactive'.
I'm trying to follow the documentation for Conclude, deactivate, or delete an enrollment and pass the inactivate task. I believe the GUI option for this is 'Deactivate'.
Enrollments - Canvas LMS REST API Documentation
-------------------------------
$response = $client->request('DELETE', 'api/v1/courses/'.$course_id.'/enrollments/'.$enrollment_id ,
[
'headers' => $headers,
'body' => json_encode($enroll_array),
]);
I'm not sure i'm reading the Docs correctly on how to provide the 'task' for this endpoint. The json body looks like this:
"["inactivate"]"
Thank you for your assistance!
Jeremiah Ellington
Holy Names University
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just resolved my issue! I needed the json to include the task parameter. Strike three for me . It's always the simple stuff that gets me..
"{"task":"inactivate"}"
Thanks again!!
Jeremiah Ellington
Holy Names University