Retrieve user's enrolled courses after they logged into OAuth2.0 and got access token
I'm still not sure how to use that retrieve what courses the student is enrolled in. The goal is, the student clicks on the webapp, it redirects for OAuth and after that the backend gets an access token. What I want is after this step, is to check what courses the user is in.
I was looking through the documentation and I found that "(for example, the actions you’d use to find the courses a user is enrolled in are associated more directly with the enrollment and course resources)." stated in the Users page.
I may be doing it wrong.
Best Answer
-
Hi Ka
If you are using the current user's account then the MyEnrollments call will retrieve the list of all enrollments for the current user.
If you are using a Service User/Account approach for admin scripts etc the following call will retrieve a list of all enrollments for the provided user
Thereafter you can filter the returned results using the OrgUnitTypeId = Course Offering
Hope that helps!