You are here

You are here

Reset Password

The ResetPassword method can be used to send password reset or activation emails.

Vertical Tabs

c#
SCMContactInfo[] users = springCMService.ContactFind(token, "jdoe@springcm.com", false);
 
if (users.Length > 0 && users[0] is SCMUserAccount)
{
    springCMService.ResetPassword(token, (SCMUserAccount)users[0]);
}
java
SCMContactInfo[] users = springService.contactFind(token, "jdoe@springcm.com", false);
 
if (users.length == 1 && users[0] instanceof SCMUserAccount )
{
    springService.resetPassword(token, (SCMUserAccount)users[0]);
}
php
<?php
 
class ContactInfo {
	public $Id;
	public $ObjectType;
}
class User extends ContactInfo {
	public $FirstName;
	public $LastName;
	public $Email;
	public $Role;
	public $Status;
}
 
$classMap = array( 'SCMContactInfo'=>'ContactInfo', 'SCMUser'=>'User' );
 
$springCM = new SoapClient('https://soapna11.springcm.com/atlas/webservices/v201305/springcmservice.asmx?wsdl',
	array ('classmap'=>$classMap));
 
$authResult = $springCM->AuthenticateNonDefault( array(
	'userName'=>'<your id>',
	'password'=>'<your password>',
	'AccountId'=>'<your account id>',
	'apiKey'=>'<your api key>'
));
 
$token = $authResult->AuthenticateNonDefaultResult;
 
$userId = '<email of the user to reset>';
 
$userResult = $springCM->ContactFind( array(
	'token'=>$token,
	'SearchText'=>$userId,
	'IncludeDeleted'=>false
));
$userResult = $userResult->ContactFindResult;
 
$scmUser = new User();
foreach($userResult->SCMContactInfo as $property => $value)
{
	$scmUser->$property = $value;
}
 
$springCM->ResetPassword( array (
	'token'=>$token,
	'user'=>$scmUser
));
 
?>