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

core_user_get_users_by_field returning empty array

$
0
0
by Carles Franquesa.  

Hi all,

Trying to use moodle APIs. All steps in the overview web services have been met. Let me tell:

step 1. Web services enabled for the site:



step 2.  REST protocol enabled:


step 3. A specific user has been created:



step 4. External service called aodb created, including these five services



step 5. A new role, "rol_aodb", with all required capabilities has been created, and the new user has been assigned to it



step 6. A token has also been created for the user on the service.

Once all this done, I can create a user through the url browser bar!

https://proves.aprenonline.org/webservice/rest/server.php?wstoken=53edt6782ceb99e6263a37e1d510a585&moodlewsrestformat=json&wsfunction=core_user_create_users&users[0][username]=33333333&users[0][firstname]=Bart&users[0][lastname]=Simpson&users[0][email]=a33@a.aaa&users[0][password]=33333333"

And it works!

The result given back is [{"id":4,"username":"33333333"}]  

And looking at the system administration/users, it certainly has been created.



The Problem

is that when I ask for the  new user Bart Simpson, no response is given:

https://proves.aprenonline.org/webservice/rest/server.php?wstoken53edt6782ceb99e6263a37e1d510a585&
moodlewsrestformat=json&
wsfunction=core_user_get_users_by_field&
field=username&
values[0]=33333333


Can someone tell me something about what I am doing wrong?

Thanks a lot. Your response will be infinitely appreciated!


Carles

(all tokens in this document are invented)




Viewing all articles
Browse latest Browse all 2361

Trending Articles



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