Good afternoon,
I'm trying to access user enrolled courses via the API (this is for a specified user, not the user I am authenticated as).
Using this endpoint: https://docs.valence.desire2learn.com/res/enroll.html#get--d2l-api-lp-(version)-enrollments-users-(userId)-orgUnits- I am receiving a 403 error, despite my scope being:
Any help is greatly appreciated.
Regards,
Daniel
Hi Daniel,
The scopes look good. Ensure the user making the API call has the permission required to view the target user’s enrollments and role. Check:
See permisison details noted at the top of the community resource https://docs.valence.desire2learn.com/res/enroll.html
Hope that helps!
Hi @Chris.S.534 ,
Thanks for your reply.
I've set the permissions you've mentioned above - for reference the account I'm testing this with is a Super Admin → I've then set:
I've rotated the access token, but am still receiving a 403 on this endpoint:
https://xyz.brightspace.com/d2l/api/lp/1.9/enrollments/users/211/orgUnits/
If there's anything else I can check, please let me know.
Hi @Daniel.G.5794,
One thing I'd suggest double-checking is the role of the target user whose enrollments you're trying to retrieve.
The route documentation notes that the results returned depend on whether the calling user can view the target user's enrollments and role within the shared org unit context.
https://docs.valence.desire2learn.com/res/enroll.html#get--d2l-api-lp-(version)-enrollments-users-(userId)-orgUnits-
When you mention:
"the account I'm testing this with is a Super Admin"
Could you clarify whether the authenticated API user is a Super Admin, or whether the user whose enrollments you're attempting to retrieve is a Super Admin?
The various Search for {roleName} permissions control a role's ability to search for enrollments belonging to users in the specified role. If the target user is enrolled in another role, it may be worth confirming that the appropriate Search for {roleName} permission is enabled as well.
I hope this helps!
Thanks,
Carolina
Connect with our Known and Fixed Issue information to learn about improvements made to Brightspace.
Connect with leaders in pedagogy, accessibility, learning experience design and more
The Accessibility category serves as a single point of access to three avenues in Brightspace Community leading to the Accessibility Academy, Accessibility Library and Accessibility Discussions. These avenues offer courses and articles about accessibility to enhance accessibility knowledge and a group of accessibility enthusiasts to stay connected with.
Have questions about how to use Community? Stay tuned with updates, feedback opportunities and more for the Community here!
Connect with and ask questions on how to best use the Brightspace Product to transform the way your users learn!
Connect with product experts to learn more about tools frequently used by Brightspace Developers such as APIs and integrations!
Want to learn more about Brightspace Partners and Integrations? This is the place to be!
Stay up to date with product updates and announcements in this category.
Connect with our release information to learn about monthly improvements and updates to Brightspace.
Learn more about all the upskilling opportunities with courses and resources offered via the Brightspace Learning Center, Brightspace Guided Training and other training opportunities!