Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

Re: moodle REST Web Services optiional fields not work

$
0
0

by Mohammed Essaid MEZERREG.  

The second way is the correct one, also you should use the same name of the custom field when you created it also, the function is core_user_create_users so as the function mentions it's 'users' and not 'user' plural taking all this in mind this is how you create a new user or n users:

assuming that you have userOne to userN classes ready and you want to pass them to the in a post request:

first you should wrap them in an array like this : $users = array($userOne, $userTwo, ...., $userN);

then wrap them in the list of users (it can be an object or an array) : $param = array("users" => $users);


you can also make it short like this $param = array("users" => array($userOne, $userTwo, ..... , $userN)):

then pass the $param to your method or function that will handle the post request


Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>