What is the most efficient why to get all Instructor enrolments for a user, using the Valence API.

Currently I am using this:

/d2l/api/lp/1.0/enrollments/users/{userid}/orgUnits/?roleid={Instructor}
有帮助吗?

解决方案

That is the correct call to use for this information. You can further filter the returned list to a particular org unit type with ?orgUnitTypeId={ouTypeId}, if you only want to see course offerings. This can be useful, for example, to filter out all Groups and Sections from the list that would also get returned in the call that you use, or any custom org units where the user is enrolled as an 'Instructor' role that's not strictly a course (like a Department, Faculty, or other custom org unit).

If you want to see all the enrollments for a user where the enrolled role is 'Instructor' (provided you pass in the role ID for 'Instructor'), then your API is the one you want.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top