Found this content helpful? Log in or sign up to leave a like!

How to get all Courses in EnrollmentTerm via API?

Jump to solution
nbpenn
Community Member

Hi - is there a way to get all Courses of an EnrollmentTerm through the api, either through REST or GraphQL? 

In the GraphQL ui, for `allCourses` - there doesn't seem to be a way to apply a filter, something like:

```
query CoursesByTermQuery {
   allCourses(filter: {term: [enrollmentTermId]})
...
```

The REST Search API, returns course listings, seems to only be applying the `search=[search term]` to the Name of the Course - is there a way to pass in an argument to search by EnrollmentTerm id?

The EnrollmentTerm API can `include[]` a `course_count` but not the actual courses? 

There seems like there are some different options to access the Courses, but I'm not seeing anything that allows filters on the Course `term_id` property specifically.

Maybe I'm missing something in the docs..?

Thanks for any thoughts

Labels (4)
0 Likes
1 Solution
chriscas
Community Coach
Community Coach

Hi @nbpenn,

The list active courses in an account API should be the one you need for this task.  You can supply the enrollment_term_id as a parameter to get results for a specified term (I use this call quite frequently with the term specified).

I hope this helps!

-Chris

View solution in original post

0 Likes