Using the API efficiently

Jump to solution
VicKovacs
Community Member

I need to get enrollments for each section in each course in semesters of interest.  To do this, I load the list of semesters to get numeric IDs, filter those, then walk the semesters and get a list of courses and filter those, then walk the courses, then walk the sections, then for each of those, walk the roles, then walk the enrollments.

This way, I have to make an API call for each node in the tree.  Is there any way to make a filtered, recursive API call that will get, say, filtered enrollments for a semester?

Surely there is something better (without learning a new technology).  I just want to stick to HTTPS API calls.

Labels (1)
0 Likes
1 Solution
dgrobani
Community Champion

You might consider using the API to request an account report, which will give you the same enrollments CSV file you can get through Settings/Reports in the UI. You submit the request, check the progress, and when it's ready, download the file.

I have a Python function I use to do this and would be happy to post it.

 

View solution in original post