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):