Skip to main content

CourseApiClient

Contains all the endpoints needed to manage events.

Constructors

Constructor

new CourseApiClient(): CourseApiClient

Returns

CourseApiClient

Methods

changeCourseCover()

static changeCourseCover(id, data, config?): Promise<SCCourseType>

This endpoint changes the course avatar

Parameters

ParameterTypeDescription
idstring | number
dataFormData
config?AxiosRequestConfig

Returns

Promise<SCCourseType>


changeCourseUserRole()

static changeCourseUserRole(id, data, config?): Promise<any>

This endpoint allows user managers to change the role of some users in the specified course.

Parameters

ParameterTypeDescription
idstring | number-
dataCourseUserRoleParams
config?AxiosRequestConfig

Returns

Promise<any>


createCourse()

static createCourse(data, config?): Promise<SCCourseType>

This endpoint creates a course.

Parameters

ParameterTypeDescription
dataCourseCreateParams | FormData
config?AxiosRequestConfig

Returns

Promise<SCCourseType>


createCourseComment()

static createCourseComment(id, section_id, lesson_id, data, config?): Promise<SCCourseCommentType>

This endpoint creates a course comment.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
dataSCCourseCommentType
config?AxiosRequestConfig

Returns

Promise<SCCourseCommentType>


createCourseLesson()

static createCourseLesson(data, config?): Promise<SCCourseLessonType>

This endpoint creates a course lesson.

Parameters

ParameterTypeDescription
dataSCCourseLessonType
config?AxiosRequestConfig

Returns

Promise<SCCourseLessonType>


createCourseSection()

static createCourseSection(id, data, config?): Promise<SCCourseSectionType>

This endpoint creates a course section.

Parameters

ParameterTypeDescription
idstring | number-
dataCourseSectionParams
config?AxiosRequestConfig

Returns

Promise<SCCourseSectionType>


deleteCourse()

static deleteCourse(id, config?): Promise<any>

This endpoint deletes a course.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


deleteCourseComment()

static deleteCourseComment(id, section_id, lesson_id, comment_id, config?): Promise<any>

This endpoint deletes a course comment.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
comment_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


deleteCourseLesson()

static deleteCourseLesson(id, section_id, lesson_id, config?): Promise<any>

This endpoint deletes a course lesson.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


deleteCourseSection()

static deleteCourseSection(id, section_id, config?): Promise<any>

This endpoint deletes a course section.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


getCourseComments()

static getCourseComments(id, params?, config?): Promise<SCPaginatedResponse<SCCourseCommentType>>

This endpoint retrieves the course comments.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCourseCommentType>>


getCourseDashboardUsers()

static getCourseDashboardUsers(id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint retrieves the list of all users that joined the course identified by Id it will also return some useful stats that can be used to make a course dashboard.

Parameters

ParameterTypeDescription
idstring | number
params?CourseDashboardUsersParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getCourseInvitedUsers()

static getCourseInvitedUsers(id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint returns a list of invited users.

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getCourseJoinedUsers()

static getCourseJoinedUsers(id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint returns a list of joined users.

Parameters

ParameterTypeDescription
idstring | number
params?CourseUsersParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getCourseLesson()

static getCourseLesson(id, section_id, lesson_id, config?): Promise<SCCourseLessonType>

This endpoint retrieves a specific course lesson.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCourseLessonType>


getCourseLessonComment()

static getCourseLessonComment(id, section_id, lesson_id, comment_id, config?): Promise<SCCourseCommentType>

This endpoint retrieves a specific course comment.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
comment_idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCourseCommentType>


getCourseLessonComments()

static getCourseLessonComments(id, section_id, lesson_id, params?, config?): Promise<SCCourseCommentType[]>

This endpoint retrieves the comments for a specific course lesson.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
params?CourseLessonCommentsParams
config?AxiosRequestConfig

Returns

Promise<SCCourseCommentType[]>


getCourseLessons()

static getCourseLessons(id, section_id, config?): Promise<SCCourseLessonType[]>

This endpoint retrieves the course lessons.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCourseLessonType[]>


getCourseSection()

static getCourseSection(id, section_id, config?): Promise<SCCourseSectionType>

This endpoint retrieves a specific course section.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCourseSectionType>


getCourseSections()

static getCourseSections(id, config?): Promise<SCCourseSectionType[]>

This endpoint retrieves the course sections.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCourseSectionType[]>


getCourseStatus()

static getCourseStatus(id, config?): Promise<any>

This endpoint retrieves the course subscription status.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


getCourseSuggestedUsers()

static getCourseSuggestedUsers(id, search, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint returns a list of suggested users to invite to the course.

Parameters

ParameterTypeDescription
idstring | number
searchstring
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getCourseWaitingApproval()

static getCourseWaitingApproval(id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

This endpoint returns all waiting approval subscribers

Parameters

ParameterTypeDescription
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


getJoinedCourses()

static getJoinedCourses(params?, config?): Promise<SCPaginatedResponse<SCCourseType>>

This endpoint retrieves all the events of the logged-in user.

Parameters

ParameterTypeDescription
params?CourseUserParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCourseType>>


getSpecificCourseInfo()

static getSpecificCourseInfo(id, params?, config?): Promise<SCCourseType>

This endpoint retrieves a specific course.

Parameters

ParameterTypeDescription
idstring | number
params?CourseInfoParams
config?AxiosRequestConfig

Returns

Promise<SCCourseType>


getUserJoinedCourses()

static getUserJoinedCourses(id, params?, config?): Promise<SCPaginatedResponse<SCCourseType>>

This endpoint retrieves a specific course.

Parameters

ParameterTypeDescription
idstring | number
params?CourseUsersParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCourseType>>


inviteOrAcceptUsersToCourse()

static inviteOrAcceptUsersToCourse(id, data, config?): Promise<any>

This endpoint allows to invite or accept a course invite.

Parameters

ParameterTypeDescription
idstring | number
data{ users: number[]; }
data.usersnumber[]-
config?AxiosRequestConfig

Returns

Promise<any>


joinOrAcceptInviteToCourse()

static joinOrAcceptInviteToCourse(id, config?): Promise<SCCourseType>

This endpoint subscribes to a course.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCCourseType>


leaveOrRemoveCourseRequest()

static leaveOrRemoveCourseRequest(id, params?, config?): Promise<any>

This endpoint unsubscribes from a course.

Parameters

ParameterTypeDescription
idstring | number
params?{ user: number; }-
params.user?number-
config?AxiosRequestConfig

Returns

Promise<any>


markLessonComplete()

static markLessonComplete(id, section_id, lesson_id, config?): Promise<any>

This endpoint marks a course lesson as complete.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


markLessonIncomplete()

static markLessonIncomplete(id, section_id, lesson_id, config?): Promise<any>

This endpoint marks a course lesson as incomplete.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


patchCourse()

static patchCourse(id, data, config?): Promise<SCCourseType>

This endpoint patches a course.

Parameters

ParameterTypeDescription
idstring | number
dataPartial<SCCourseType> | FormData
config?AxiosRequestConfig

Returns

Promise<SCCourseType>


patchCourseComment()

static patchCourseComment(id, section_id, lesson_id, comment_id, data, config?): Promise<SCCourseCommentType>

This endpoint patches a course comment.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
comment_idstring | number
dataSCCourseLessonType
config?AxiosRequestConfig

Returns

Promise<SCCourseCommentType>


patchCourseLesson()

static patchCourseLesson(id, section_id, lesson_id, data, config?): Promise<SCCourseLessonType>

This endpoint patches a course lesson.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
dataPartial<SCCourseLessonType>
config?AxiosRequestConfig

Returns

Promise<SCCourseLessonType>


patchCourseSection()

static patchCourseSection(id, section_id, data, config?): Promise<SCCourseSectionType>

This endpoint patches a course section.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
dataSCCourseSectionType
config?AxiosRequestConfig

Returns

Promise<SCCourseSectionType>


removeInvitationToCourse()

static removeInvitationToCourse(id, data, config?): Promise<any>

This endpoint allows to remove invites.

Parameters

ParameterTypeDescription
idstring | number
data{ users: number[]; }
data.usersnumber[]-
config?AxiosRequestConfig

Returns

Promise<any>


searchCourses()

static searchCourses(params?, config?): Promise<SCPaginatedResponse<SCCourseType>>

This endpoint performs events search

Parameters

ParameterTypeDescription
params?CourseSearchParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCCourseType>>


updateCourse()

static updateCourse(id, data, config?): Promise<SCCourseType>

This endpoint updates a course.

Parameters

ParameterTypeDescription
idstring | number
dataSCCourseType | FormData
config?AxiosRequestConfig

Returns

Promise<SCCourseType>


updateCourseComment()

static updateCourseComment(id, section_id, lesson_id, comment_id, data, config?): Promise<SCCourseCommentType>

This endpoint updates a course comment.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
comment_idstring | number
dataSCCourseCommentType
config?AxiosRequestConfig

Returns

Promise<SCCourseCommentType>


updateCourseLesson()

static updateCourseLesson(id, section_id, lesson_id, data, config?): Promise<SCCourseLessonType>

This endpoint updates a course lesson.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
lesson_idstring | number
dataSCCourseLessonType
config?AxiosRequestConfig

Returns

Promise<SCCourseLessonType>


updateCourseSection()

static updateCourseSection(id, section_id, data, config?): Promise<SCCourseSectionType>

This endpoint updates a course section.

Parameters

ParameterTypeDescription
idstring | number
section_idstring | number
dataSCCourseSectionType
config?AxiosRequestConfig

Returns

Promise<SCCourseSectionType>