p1: partition username
p3: course name to enroll user into
p4: OPTIONAL start date YYYYMMDD
p5: OPTIONAL end date YYYYMMDD
Boolean (true or false)
Enrolls an existing user from specified account into specified course. Returns true if user was enrolled, or false if it failed (or if user does not exist).
The p4 and p5 parameters are optional. They are used for setting an enrollment window of dates -- the date format should be YYYYMMDD, so for example a date of May 1, 2016 would be represented like this: 20160501.
Example (using Code Kit):
// assumes partition username "anthony" exists
// try to enroll username Bob into course named Sample Course
$data = APICommand( "user__enroll", "anthony", "Bob", "Sample Course" );
$xml = simplexml_load_string( $data );