3

Using curl, I'm trying to make a rest call to the web service function to create a user. However, I'm oblivious as to what the required parameters are and can't find any documentation on this.

I'm getting the error:

url: mymoodle/webservice/rest/server.php?wstoken=304632866235d8239cd7bf41809dcd03&wsfunction=core_user_create_users&criteria[0][key]=username&criteria[0][value]=name&criteria[1][key]=password&criteria[1][value]=password

Invalid parameter value detected Missing required key in single structure: users

Qiu
  • 5,651
  • 10
  • 49
  • 56
succeed
  • 834
  • 1
  • 11
  • 28
  • This may not solve your problem, but I found some information in this post http://stackoverflow.com/questions/20659883/create-user-using-moodle-webservice – Lucien Stals Jul 03 '15 at 03:24

1 Answers1

5

The api documentation that provides more extensive documentation on not only what the required parameters are for all the available webservice functions but also the expected response and their structures in both REST and XML-RPC is accessible from the moodle site.

For access to these docs you must have admin access as they are found in admin submenu located at :

site administration > Plugins > Web services > API Documentation

Parameters for the 'core_user_create_users' function

succeed
  • 834
  • 1
  • 11
  • 28