uw_canvas/enrollments.py
def enroll_user(self, course_id, user_id, enrollment_type, params=None):
        """
        Enroll a user into a course.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.create
        """
        url = COURSES_API.format(course_id) + "/enrollments"

        if not params:
            params = {}

        params["user_id"] = user_id
        params["type"] = enrollment_type

        data = self._post_resource(url, {"enrollment": params})
        return CanvasEnrollment(data=data)
def enroll_user(self, course_id, user_id, enrollment_type, params=None):
        url = COURSES_API.format(course_id) + "/enrollments"

        if not params:
            params = {}

        params["user_id"] = user_id
        params["type"] = enrollment_type

        data = self._post_resource(url, {"enrollment": params})
        return CanvasEnrollment(data=data)
def enroll_user ( self , course_id , user_id , enrollment_type , params = None ) : url = COURSES_API . format ( course_id ) + "/enrollments" if not params : params = { } params [ "user_id" ] = user_id params [ "type" ] = enrollment_type data = self . _post_resource ( url , { "enrollment" : params } ) return CanvasEnrollment ( data = data )
Enroll a user into a course.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.create
Enroll a user into a course .