canvas::API method account courses (public)

 <instance of canvas::API[i]> account courses \
    [ -with_enrollments with_enrollments ] \
    [ -enrollment_type enrollment_type ] [ -published published ] \
    [ -completed completed ] [ -blueprint blueprint ] \
    [ -blueprint_associated blueprint_associated ] \
    [ -by_teachers by_teachers ] [ -by_subaccounts by_subaccounts ] \
    [ -hide_enrollmentless_courses hide_enrollmentless_courses ] \
    [ -state state ] [ -enrollment_term_id enrollment_term_id ] \
    [ -search_term search_term ] [ -include include ] [ -sort sort ] \
    [ -order order ] [ -search_by search_by ] \
    [ -starts_before starts_before ] [ -ends_after ends_after ] \
    [ -homeroom homeroom ] [ -page page ] [ -per_page per_page ] \
    [ -max_entries max_entries ] account_id

Defined in packages/xooauth/tcl/canvas-procs.tcl

Retrieve a paginated list of courses in this account. Details: https://canvas.instructure.com/doc/api/accounts.html

Switches:
-with_enrollments (optional)
If true, include only courses with at least one enrollment. If false, include only courses with no enrollments. If not present, do not filter on course enrollment status.
-enrollment_type (optional)
If set, only return courses that have at least one user enrolled in the course with one of the specified enrollment types. Allowed values: teacher, student, ta, observer, designer
-published (optional)
If true, include only published courses. If false, exclude published courses. If not present, do not filter on published status.
-completed (optional)
If true, include only completed courses (these may be in state 'completed', or their enrollment term may have ended). If false, exclude completed courses. If not present, do not filter on completed status.
-blueprint (optional)
If true, include only blueprint courses. If false, exclude them. If not present, do not filter on this basis.
-blueprint_associated (optional)
If true, include only courses that inherit content from a blueprint course. If false, exclude them. If not present, do not filter on this basis.
-by_teachers (optional)
List of User IDs of teachers; if supplied, include only courses taught by one of the referenced users.
-by_subaccounts (optional)
List of Account IDs; if supplied, include only courses associated with one of the referenced subaccounts.
-hide_enrollmentless_courses (optional)
If present, only return courses that have at least one enrollment. Equivalent to 'with_enrollments=true'; retained for compatibility.
-state (optional)
If set, only return courses that are in the given state(s). By default, all states but “deleted” are returned. Allowed values: created, claimed, available, completed, deleted, all.
-enrollment_term_id (optional)
If set, only includes courses from the specified term.
-search_term (optional)
If set, only includes courses from the specified term.
-include (optional)
List of extra values to be included. Allowed values: syllabus_body, term, course_progress, storage_quota_used_mb, total_students, teachers, account_name, concluded
-sort (optional)
The column to sort results by. Allowed values: course_name, sis_course_id, teacher, account_name
-order (optional)
the order to sort the given column by. Allowed values: asc, desc
-search_by (optional)
The filter to search by. “course” searches for course names, course codes, and SIS IDs. “teacher” searches for teacher names Allowed values: course, teacher
-starts_before (optional)
If set, only return courses that start before the value (inclusive) or their enrollment term starts before the value (inclusive) or both the course's start_at and the enrollment term's start_at are set to null. The value should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ.
-ends_after (optional)
If set, only return courses that end after the value (inclusive) or their enrollment term ends after the value (inclusive) or both the course's end_at and the enrollment term's end_at are set to null. The value should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ.
-homeroom (optional)
If set, only return homeroom courses.
-page (optional, defaults to "1")
Return the nth page of the result set
-per_page (optional, defaults to "10")
Return this number of entries per page
-max_entries (optional)
perform potentially multiple requests until the requested number of entries can be returned.
Parameters:
account_id (required, integer)

Testcases:
No testcase defined.
Source code:
set r [:request -method GET -token ${:token}  -url /accounts/${account_id}/courses?[:params {page per_page
               with_enrollments enrollment_type:array
               published completed blueprint blueprint_associated
               by_teachers:array by_subaccounts:array
               hide_enrollmentless_courses state:array
               enrollment_term_id search_term
               include:array sort order search_by
               starts_before ends_after homeroom
               }]]
return [:paginated_result_list -max_entries $max_entries $r 200]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: