cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bbennett2
Community Champion

Access Student Enrollments in a Subaccount

Does anyone know of a way to access all student enrollments for a subaccount without looping each course? I'd like to do it from the subaccount so we can apply changes to a couple of buildings rather than to the entire district.

The only way I can see to programmatically access StudentEnrollments is through courses or sections and that's a ton of I/O. I could also pull a big CSV and get IDs from there into an array to loop, but again, we'd have to run that report periodically to have an up-to-date roster. Any tips are appreciated.

Labels (1)
0 Kudos
3 Replies
robotcars
Community Champion

Brian,

I haven't figured out a way without doing a lot of API.

Canvas Data includes account_id in the course_dim with account_dim holding ids for the parent and grandparent accounts. I use this to separate all our enrollments by school.

bbennett2
Community Champion

I ended up using the Provisioning report tool in the admin panel to get a CSV for each subaccount's users and then filtered from there. The end goal was to update student notification preferences as an admin, but only for a portion of our buildings. I got it working and will try to get a blog post up on what we end up doing.

robotcars
Community Champion

Nice. That works.

We use CD to get the communication channels of the student, specifically their district assigned email, to update their preferences before sending notifications.