Accessing course enrollments through API calls

Options
Peter.S.773
Peter.S.773 Posts: 3 🔍
edited January 2 in Development
I'm accessing https://docs.valence.desire2learn.com/res/enroll.html#get--d2l-api-lp-(version)-enrollments-myenrollments-.

However, I keep receiving "Message: "Insufficient scope to call API.Required: core:*:*""

I've added the scopes "core:*:*" and "enrollment:own_enrollment:read" to my Oauth2 application and yet the error persists. How can I fix this?
Tagged:

Answers

  • Tauany.S.691
    Options

    Hi Peter,

    Thank you for your question. Are you receiving the status code 403? If so, this error could be related to the Brightspace permission to see enrollments.

    Below is the documentation about the User Permissions where you can see more information about the "View User Enrollments" permission and others.

    https://community.d2l.com/brightspace/kb/articles/4515-user-management-permissions

    Thank you,

    Tauany

  • Steve.B.446
    Steve.B.446 Posts: 68
    Options

    I may be way off the mark here, but the "my" type API calls tend to be used for things like widgets and refer to the authenticating user's scope.

    If you are using OAuth with a service type account then "my" enrolments might not make a lot of sense in that context and you need to use one of the other API routes where you can specify the user whose enrolments you want?