core_user_get_users on custom fields

core_user_get_users on custom fields

by Zadok Lindt -
Number of replies: 0

I am aware we can do this:

https://example.com/moodle/webservice/rest/server.php?wstoken=secret&wsfunction=core_user_get_users&moodlewsrestformat=json&criteria[0][key]=email&criteria[0][value]=person@example.com

I can't seem to work out how to do this for custom fields, i.e. If you have another field "secondary_email", this doesnt appear to work for me:

https://example.com/moodle/webservice/rest/server.php?wstoken=secret&wsfunction=core_user_get_users&moodlewsrestformat=json&criteria[0][key]=secondary_email&criteria[0][value]=person@example.com

I realise there might be some trick to make a "customfields" array, my googling has come across some vaguely related PHP code, but we are not using PHP (thus I am attempting to work out how to build the URL without php.

Thanks!

Average of ratings: -