How to obtain the idnumber of a user using core_user_get_users

How to obtain the idnumber of a user using core_user_get_users

by Alberto Mozo Avellaned -
Number of replies: 3

Hello : 

I'm beggining in the Moodle Webservices. I'm trying to obtain all the fields of an user throught the id. I'm using the  'core_user_get_users' and only return the a few field. 

My code is : 

$params4 = array( 'criteria' => array(0 => array (
'key' => 'id',
'value' => $usuarioid)
));

$functionname = 'core_user_get_users';
$options = array('idnumber');

  try {

  $resp4 = $client1->__soapCall($functionname, $params4);

   print_r($resp4);

.....

and only obtain 

Array ( [users] => Array ( [0] => Array ( [id] => 23 [firstname] => Raul [lastname] => prueba [fullname] => Raul prueba [email] => p@p.com [firstaccess] => 0 [lastaccess] => 0 [profileimageurlsmall] => http:///aula/pluginfile.php?file=%2F816%2Fuser%2Ficon%2Ff2 [profileimageurl] => http:///aula/pluginfile.php?file=%2F816%2Fuser%2Ficon%2Ff1 ) ) [warnings] => Array egg )

How can I add fields to this answer?  

I'm trying to using other array in the function call but I'm lost.

Thanks in advance.


Alberto Mozo



Average of ratings: -
In reply to Alberto Mozo Avellaned

Re: How to obtain the idnumber of a user using core_user_get_users

by Léo Joseph -

Same problem for me how is it possible ?

In reply to Alberto Mozo Avellaned

Re: How to obtain the idnumber of a user using core_user_get_users

by Léo Joseph -

I resolve this issue,

 

Your user which call the webservice need to be administrator for that's working !