enrol_manual_enrol_users
This function manually enrols one or more users into a specified course with a specific role.
Let's review the POST parameters for this function:
- Required Parameters:
enrolments[0][roleid]= int (Required: The numeric ID for the role to assign, e.g., 5 for 'Student'.)enrolments[0][userid]= int (Required: The numeric ID of the user to enrol.)enrolments[0][courseid]= int (Required: The numeric ID of the course.)
- Optional Parameters:
enrolments[0][timestart]= int (Optional: A Unix timestamp for when the enrolment should begin.)enrolments[0][timeend]= int (Optional: A Unix timestamp for when the enrolment should end.)enrolments[0][suspend]= int (Optional: Set to 1 to make the enrolment suspended, or 0 for active.)
cURL Command Example (Enrolling a User):
core_enrol_get_enrolled_users
This function retrieves a list of all users who are enrolled in a specific course.
Let's review the POST parameters for this function:
- Required Parameter:
courseid= int (Required: The numeric ID of the course.)
cURL Command Example (Getting Enrolled Users):
enrol_manual_unenrol_users
This function manually removes one or more users from a specified course.
Let's review the POST parameters for this function:
- Required Parameters:
enrolments[0][userid]= int (Required: The numeric ID of the user to be unenrolled.)enrolments[0][courseid]= int (Required: The numeric ID of the course from which to unenrol the user.)
cURL Command Example (Unenrolling a User):