Click or drag to resize

AdministrationClientCreateSecurityAccount Method

Create a new Security Account, from the submitted values.

Syntax
C#
public Result CreateSecurityAccount(
	ManagementGroupRequestOfManagementGroupCredentialsOfguid request
)

Parameters

request
Type: AdministrationServiceManagementGroupRequestOfManagementGroupCredentialsOfguid

Return Value

Type: Result
Examples
C#
using (var svc = new AdministrationService.AdministrationClient())
{
  var request = new AdministrationService.ManagementGroupRequestOfManagementGroupCredentialsOfguid();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  var managementGroupCredentialsOfguid = new AdministrationService.ManagementGroupCredentialsOfguid();
  managementGroupCredentialsOfguid.AccountName = "Account name"; //Required - Must be unique to the management group
  managementGroupCredentialsOfguid.SecurityCode = "Password"; //Required - Password must be between 8 and 20 characters long and include at least one letter and one number.
  managementGroupCredentialsOfguid.AccountOwnerRSN = new Guid("d78fed9e-078f-45dd-8828-9dbb6269763b");; //Required - Member who will own the security account
  managementGroupCredentialsOfguid.EmailAddress = "john.doe@simplicitycrm.com"; //Required - The email address to recieve activation requests and password reset requests
  managementGroupCredentialsOfguid.ManagementGroup = "LOYALTY_MEMBER"; //Required - The management group for the new account.

  // add newSecurityAccount to request
  request.Value = managementGroupCredentialsOfguid;

  AdministrationService.Result result = svc.CreateSecurityAccount(request);
  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed        
    throw new Exception(result.FaultDescription);
  }
}
See Also