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

moodle REST Web Services optiional fields not work

$
0
0

by Edgar Vargas.  

I created a service for moodle with the information I found on this page http://www.spanidis.eu/?p=27 but I have a drawback, I need to create the user with the field "department" but to pass it as parameter I get error. How can I field this field?

Try it from the following:


$user1 = new stdClass();
$user1->username    = $username;
$user1->password    = $password;
$user1->firstname   = $firstname;
$user1->lastname    = $lastname;
$user1->email       = $email;
$user1->auth        = 'manual';
$user1->idnumber    = 'numberID';
$user1->lang        = 'en';
$user1->city        = $city;
$user1->country     = $country;
$user1->description = $description;
$user1->department = $department;
and so


$user1 = new stdClass();
$user1->username    = $username;
$user1->password    = $password;
$user1->firstname   = $firstname;
$user1->lastname    = $lastname;
$user1->email       = $email;
$user1->auth        = 'manual';
$user1->idnumber    = 'numberID';
$user1->lang        = 'en';
$user1->city        = $city;
$user1->country     = $country;
$user1->description = $description;
$user1->customfields = array(
            array('type' => 'department', 'value' => $department)
           );


Viewing all articles
Browse latest Browse all 2361

Trending Articles



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