/
Deleting course enrollments via web service
Deleting course enrollments via web service
Deletion of a course_enrollment record via web services removes all related learner content, including the course_report record, course_outline_fulfillment records, and course_credit_awarded records. It will also cascade deletions to the child enrollments if deleting the parent course of a course relationship.
$curl = curl_init("http://your-domain.com/course_enrollment/1234"); // Note the 1234, which is the enrollment id of the course_enrollment entity record
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "restws_webservice:webservice_password"); //Your credentials goes here
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
print 'Deleting...';
$json = curl_exec($curl);
$cinfo = curl_getinfo($curl);
$response = json_decode($json);
if($cinfo['http_code'] == 200 && empty($response)){
print 'The entity has been deleted'.
}
, multiple selections available,
Related content
Enrolling a user via web service
Enrolling a user via web service
More like this
Web Service Endpoints
Web Service Endpoints
Read with this
Deleting a Course Object
Deleting a Course Object
More like this
Queuing user enrollments via the course record import feature
Queuing user enrollments via the course record import feature
Read with this
Withdrawing an Imported Record from a User
Withdrawing an Imported Record from a User
More like this
Deleting an Imported Course Record
Deleting an Imported Course Record
More like this