Invalid Parameter Exception

Invalid Parameter Exception

by Francesco Virga -
Number of replies: 0

Hi there,

We are having issues setting up an integration with the Moodle Web Services API of one of our clients. We were given a user auth token, which seems to authenticate properly (when used in an API call, we don't receive any auth-related errors from the API). 

Our main task is to manually enrol specific students into courses. We are trying to use the enrol_manual_enrol_users API route, but no matter how we make the request, we receive an invalid_parameter_exception. We have tried making this request in a number of ways, none of which have produced any other results. 

We have tried other API routes such as core_course_get_contents as sanity checks but receive the same errors.

We are including moodlewsrestformat=json, wstoken={our_auth_token}, wsfunction and any route-specific arguments.

Testing with Postman, we've tried:

  • GET request,  all params are url query params
  • POST request, all params are JSON body params
  • POST request, all params are x-www-form-urlencoded
  • POST request,  moodlewsrestformat, wstoken, wsfunction are url query params, route-specific arguments are JSON body params

Once we are able to do this, we need to also query the API to fetch the userid of specific users by passing the value of a custom profile field called NetId that our client has created (students fill this in when they create their accounts). How would we go about this?

Using Moodle 3.9.1+ (Build: 20200717) on ubuntu.


Thanks,

Francesco


Average of ratings: -