Check to see if a login name already exists when a field is filled in

Check to see if a login name already exists when a field is filled in

I'm after a script that checks to see if the text entered into a field already exists in the "login_name" field under "api/v3/users"

If  there is a match, I want the field to be updated with text like "USERNAME ALREADY TAKEN" 

Is this possible? 
                New to ADManager Plus?

                  New to ADSelfService Plus?