How to get current courses when terms never have end dates

jacob_anavisca
Community Member

Heyo, currently using the REST API to provide a different experience for different universities and their users. The /api/v1/courses endpoint seems to get current courses based on the terms end date. The issue we're currently facing is that a university does not give their terms end dates. They seem to use the access_restricted_by_date property to "end" their courses. We are using the access tokens of students after they've signed in, we also would not be able to use an admin/account user, and so we wouldn't be able to make a request to the terms endpoint. One way we were thinking of handling this is to make a request to the courses endpoint with the include parameter set with terms and also using the per_page parameter to get all courses. Then determining the latest term by sorting either with the ids or names of the terms. Then filtering out all courses that aren't part of the term determined to be the latest.

This is not an efficient way to get the current courses and so I'm wondering if anyone knows of a better way. Or is there some feature request I could put in that could make this more efficient? One thought I had was a feature request to allow getting the terms of a specific student using their access token.

Labels (3)
0 Likes