Display Courses
Overview
To display courses on your website, you would usually follow a multi-step approach. The general method includes:
- Retrieving a list of publicly available courses.
- Obtaining detailed information about a specific course for an 'about' style page.
- Searching for available instances of a course to find dates, times, and locations.
It's important to understand the terminology: a course can be a class, workshop, or e-learning session. Each course may have multiple instances that students can enrol in.
Retrieve a list of courses and additional details
Clients often display courses based on their type (e.g. class or workshop). To do this, send a request to the /courses endpoint specifying the type as 'w' for a workshop or 'p' for a class. This endpoint supports further filtering based on your specific needs.
Common filtering options include:
searchTermtrainingArea(a training category)publiccurrent, andisActive
Once the user has chosen a suitable course, you can provide additional information by making a GET request to the /course/detail endpoint, specifying the appropriate ID and type parameters for the selected course.
Search available instances for a courses
A versatile way to fetch course instances is by making a POST request to /course/instances/search and using multiple parameters to filter the results.
For performant searching, we recommend you specify both id and type values. Also, be mindful to provide startDate_min and finishDate_max values that specify the date range of instances you want to display as the API default values may not meet your requirements. For the full list of parameter options, consult the API documentation for this endpoint.
For more information about a specific course instance, make a GET request to the /course/instance/detail endpoint.
/course/instances GET
There is a setting to be aware of on a Qualifications labelled "Display Web Outline" and a setting on Workshop Types labelled "Display in Bookings Calendar". These control visibility by default on the API.
In terms of the /course/instances API, a Class that belongs to a Qualification is only considered "Public" when that setting is checked. GET requests to the /course/instances API are defaulted to public = true. So to include Instances of Qualifications where that checkbox is unselected in the response, include public = false. Alternatively, you can update the "Display Web Outline" checkbox against the Qualification.
In terms of the /course/instances API, a Workshop that belongs to a Workshop Type is only considered "Public" where the coordination type of the Workshop is "Public" AND the Workshop Type has the "Display in Bookings Calendar" setting checked. So to include Public coordination type Instances of the Workshop Type where that checkbox is unselected in the response, include public = false. Alternatively, you can update the "Display in Bookings Calendar" checkbox against the Workshop Type.
Generally, a more flexible way to find instances is utilising the POST /course/instances/search API endpoint. The only point to note about this endpoint is that you need to be specific with the values for startDate_min, startDate_max, finishDate_min and finishDate_max unless the instances start within the default date ranges (- 3 months and + 3 months for both start and finish).