Courses API returning courses student not currently enrolled in

BJH
Community Member

I'm using the API to query some date from my kid's accounts - so we are looking at this from the student end, not the course instructor/designer.

I am using the API to get a list of all courses:

/api/v1/courses

This however seems to be returning courses that are not active (or at least visible any more) for my kid's account.  These seem to be courses from prior years that they were in at some point, but don't show up any more in their canvas and we don't care about.

I've examined what has been returned for the courses and I can't see anything that would differentiate them as different from an "active" standpoint.  The only two criteria I can use to filter these out are "enrollment_term_id" and possibly "created_at".

99% of the courses this semester share the same enrollment_term_id, however there is one with a unique enrollment_term_id I also need.  In fact, all the courses I *don't* want have share an enrollment term.  So programatically I can filter these out easily enough...but I feel I'm missing something.

Is there another way I can query to find only the courses which display in the student view?  Is our school administration failing to do something to properly retire classes which should no longer show?

0 Likes