Course API

Course API

core_course_get_courses

This function retrieves details about one or more courses.

Let's review the POST parameters for this function:

  1. Optional Parameter:
    • options[ids][0]= int (Optional: A numeric course ID. You can pass multiple IDs to retrieve details for specific courses.)
  2. Important Note:
    • If you do not provide any course IDs, this function will return a list of all available courses on the site.

cURL Command Example 1 (Getting Specific Courses):

curl "https://courses.yoursite.com/webservice/rest/server.php?wstoken=XXXXXXXXXXXXXXX" \
-d "wsfunction=core_course_get_courses" \
-d "options[ids][0]=789" \
-d "options[ids][1]=790"

cURL Command Example 2 (Getting All Courses):

    • Related Articles

    • Grades API

      gradereport_overview_get_course_grades This function retrieves an overview of all final course grades for a specific user. Let's review the POST parameters for this function: Optional Parameter: userid= int (Optional: The numeric ID of the user. If ...
    • Course Completion API

      core_completion_get_activities_completion_status This function checks the completion status of all activities within a course for a specific user. Let's review the POST parameters for this function: Required Parameters: courseid= int (Required: The ...
    • Course Groups API

      core_group_add_group_members This function adds one or more users to a specific group within a course. Let's review the POST parameters for this function: Required Parameters: members[0][groupid]= int (Required: The numeric ID of the group.) ...
    • Enrollment API

      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 ...
    • Calendar API

      core_calendar_create_calendar_events This function is used to create new calendar events. You can create events for a user, a course, or a group. Let's review the POST parameters for this function: Required Parameters: events[0][name]= string ...