Enrollment API

Enrollment API

enrol_manual_enrol_users

Arguments
enrolments (Required)

General structure

list of ( 
object {
roleid int   //Role to assign to the user
userid int   //The user that is going to be enrolled
courseid int   //The course to enrol the user role in
timestart int  Optional //Timestamp when the enrolment start
timeend int  Optional //Timestamp when the enrolment end
suspend int  Optional //set to 1 to suspend the enrolment
)

REST (POST parameters)

enrolments[0][roleid]= int
enrolments[0][userid]= int
enrolments[0][courseid]= int
enrolments[0][timestart]= int
enrolments[0][timeend]= int
enrolments[0][suspend]= int


core_enrol_get_enrolled_users

Arguments
courseid (Required)
        course id

General structure
int   //course id

REST (POST parameters)
courseid= int

enrol_manual_unenrol_users

Arguments
enrolments (Required)
        
General structure

list of ( 
object {
userid int   //The user that is going to be unenrolled
courseid int   //The course to unenrol the user from
)

REST (POST parameters)

enrolments[0][userid]= int
enrolments[0][courseid]= int


    • Related Articles

    • Generate your API Key

      Step 1: Click on "Site admin" > "Integrations" > "Manage tokens": Step 2: Click on "Create Token": Step 3: (1) Select the user you wish to give the API Token to, (2) Select "API" then (3) Save: Step 4: Share this token with the user or save it if ...
    • Setting Up Your API

      We advise the use of a developer to help you setup your API connection. We will offer an example of how to CREATE NEW USER on your LMS (core_user_create_users) Let's review only the required REST (POST parameters): wsfunction=core_user_create_users ...
    • User API

      core_user_create_users Arguments users (Required) General structure list of (  object { createpassword int  Optional //True if password should be created and mailed to user. username string   //Username of profile. auth string  Default to "manual" ...
    • Messaging API

      core_message_get_messages Arguments useridto (Required) the user id who received the message, 0 for any user.  useridfrom (Default to "0") the user id who send the message, 0 for any user. Note that a useridto=0 and useridfrom=0, will not work. At ...
    • Grades API

      gradereport_overview_get_course_grades Arguments userid (Default to "0")         Get grades for this user (optional, default current) General structure int  Default to "0" //Get grades for this user (optional, default current) REST (POST parameters) ...