Getting a list of ALL courses.

Jump to solution
dpharris
Community Novice

I am using the API: 

GET /api/v1/courses

The API is returning a subset of my courses, and I can't determine why. It doesn't seem to matter whether I'm a teacher, student or observer. 

I am wanting a list of all classes where I am a teacher, regardless of whether it is currently active or not.

Assistance is appreciated.

1 Solution
James
Community Champion

 @dpharris ,

 

Based on the description you give, there's a high probability that you're experiencing the built-in pagination, which limits the number of results to 10 in most cases.

If all of your responses never have more 10 responses, then this is almost certainly a component of the problem.

Try adding per_page=100 to your query string: GET /api/v1/courses/per_page=100.  And no, when you get over 100 courses, you cannot make that 100 any larger.

There are other things that might be going on, but for teachers and admins, you get all of your courses that aren't deleted by default and you probably don't care about the deleted courses. That makes me strongly suspect it's a pagination issue.

View solution in original post