Observees' Grades

Jump to solution
wuedward
Community Novice

How can I view observee's grades through the API?  Please advise.  

Labels (1)
1 Solution
llawson
Community Contributor

First, you would need to extract the Canvas IDs the observer is observing. A PowerShell snippet would look something like:

$ids = Invoke-RestMethod "https://school.instructure.com/api/v1/users/:canvas_id_of_observer/observees" -method get -headers @{"Authorization"="Bearer $auth"} | % {$_.id}

Foreach ($i in $ids) {
    invoke-restmethod "https://school.instructure.com/api/v1/users/$i/enrollments" -method get -headers @{"Authorization"="Bearer $auth"} | % { $_.grades }
}‍‍‍‍‍

View solution in original post