Connect. Communicate. Collaborate. Securely.

Home » Developer Zone » API/SDK Writers » Check user availability
  •  
Miroslav Osladil (Kerio)

Messages: 188

Karma: 27
Send a private message to this user
Do you want to create a new user and check if the address is not in conflict with another entity?

Let see how it is done in Web Administration for Kerio Connect.

During creating a new user, the background check is performed whether the picked username already exists or not. If so you can easily choose another name even before you try to send data to the server and end up with an error.

Very useful in automated registration wizards.

For example, in Kerio APIs Client Library for PHP, you can do it as follows.

$params = array(
  'addresses' => array($username),
  'updatedEntity' => array('kind' => 'EntityUser'),
  'domainId' => $domainId);

$result = $api->sendRequest('Server.findEntityByEmail', $params);
			
print ($result['entities'])
  ? 'Username is not available.'
  : 'Username is available.';


Note:
$username - requested username
$domainId - domain ID in where user is being checked

Miroslav Osladil
Senior Developer
Kerio Technologies

The views I express are my own and do not necessarily reflect the views of Kerio Technologies.
  •  
maurice

Messages: 47
Karma: 2
Send a private message to this user
Neat. I'm looking forward to the day when I have 'spare' time to play with this new API toy.

Maurice
Previous Topic: How to list domains
Next Topic: Set users quota?
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Thu Nov 23 10:37:11 CET 2017

Total time taken to generate the page: 0.00349 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.