[ARCHIVED] What is an API Call to get a list of users enrolled with a particular course role?

Jump to solution
baxl
Community Contributor

Can anyone share an API call to get a list of users enrolled with a particular course role?  I need to get a list of all users enrolled in courses with a custom created course role called Demo Viewer.  The role is based off of the observer role. 

Thanks!

Lisa

Labels (2)
1 Solution
garth
Community Champion

 @baxl ​ use the Enrollments API, specifically the call to "List enrollments":

The "role[]" parameter should get you what you are looking for: 

role[]string

A list of enrollment roles to return. Accepted values include course-level roles created by the Add Role API as well as the base enrollment types accepted by the `type` argument above.

Let me know if this helps.

View solution in original post