core_user_get_users function doesn't return the user data?

core_user_get_users function doesn't return the user data?

by Mohammed Essaid MEZERREG -
Number of replies: 2

Hello,


I am working with web services and I needed the core_user_get_users function in certain level. But it seems that there is a problem with this function (maybe may configuration) which make the function return the user data if I use the id to search of the user and return nothing if I use something other than the id like username and the other fields.

In the next picture you will see the capability overview of the role assigned to the user of web service :

capability overview

As you can see I enabled everything required by the core_user_get_users function:


When I made the request in php with the username or anything else I receive this with restformat set to json:

{"users":[],"warnings":[]}

When I use the user id, I get all his info, also it works when I use the email with the value set to "%". 

What's the problem here? 

Am I missing something?

Average of ratings: -
In reply to Mohammed Essaid MEZERREG

Re: core_user_get_users function doesn't return the user data?

by Mohammed Essaid MEZERREG -

Strangely, it's working now, without me changing anything to either  the code or the configuration, I added the get user by field but I deleted it immediately when I find that the other function start working , perhaps moodle as a soul or may be the server was giving the function a little time to execute, I think it needs more investigations.

In reply to Mohammed Essaid MEZERREG

Re: core_user_get_users function doesn't return the user data?

by Monita Dwi Nuraeni -

I was learning about core_user get_users web service. can you explain to me how to use core_user_get_users webservice ?