Questions about enrolment creation via rest API

Options
Reiss.Dick873
Reiss.Dick873 Posts: 1 🌱
edited November 2022 in Development

I am attempting to create an enrolment via the api but I am running into the following error.

 

{

    "type": "http://docs.valence.desire2learn.com/res/apiprop.html#not-authorized",

    "title": "Not Authorized",

    "status": 403,

    "detail": "Insufficient scope to call API.Required: enrollment:orgunit:create"

}

 

When i change the scope to enrollment:orgunit:create i then get this error

 

 

{"error":"invalid_scope","error_description":"Client is not authorized to request the scope enrollment:orgunit:create"}

 

 

I am using oauth2 and signing in with my credentials to get my token.

 

Not sure if I am missing something or if a permission is off.

 

Thanks

 

 

 

Tagged:

Answers

  • Viktor.H.147
    Viktor.H.147 Posts: 41
    edited November 2022
    Options

    OAuth2 clients are not allowed to request scopes for access tokens that they haven't declared at registration time that they will ask for. The application registration for this app needs to get updated to also include the "enrollment:orgunit:create" scope.