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

Re: REST API: check if user exists?

$
0
0

by e sencan.  

Hi

Moodle requires unique emails so if you have the user's email you can do a check to see if that user exists in Moodle. 

Call 'core_user_get_users' with 'criteria[0][key]=email' and 'criteria[0][value]={useremail}' where {useremail} is the user's email. Moodle will spit back a list of users matching that email. Since email has to be unique there should would one element if the user exists - the element will provide you with the userid. If no elements come back the user is not in the system and you can add them in.


Viewing all articles
Browse latest Browse all 2366

Trending Articles



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