web-servicesmoodle

Getting all users in Moodle using the webservices


I'm developing a Java client to interact with Moodle. I want to get all the users registered within a Moodle installation.

I found the webservice function called core_user_get_users which returns a list with users.

When I call the service without any parameters I get a repsonse with a invalid parameter exception.

When I add a criteria parameter (criteria[0][key]=id&criteria[0][value]=some_id) it returns a single user with that specific id.

I can't seem to find what criteria to pass to the function to get the entire list with users registered.


Solution

  • You can use the email criteria. If you have the value %% it will retrieve all registered users.