Add Contact Print

  • 0

addcontact

Purpose

This command is used to create a new contact under an account.

Attributes

Optional Attributes

  • firstname
  • lastname
  • companyname
  • email - must be unique if creating a sub-account
  • address1
  • address2
  • city
  • state
  • postcode
  • country - two letter ISO country code
  • phonenumber
  • password2 - if creating a sub-account
  • permissions - can specify sub-account permissions eg manageproducts,managedomains
  • generalemails - set true to receive general email types
  • productemails - set true to receive product related emails
  • domainemails - set true to receive domain related emails
  • invoiceemails - set true to receive billing related emails
  • supportemails - set true to receive support ticket related emails

Example Command

$postfields = array();
$postfields["responsetype"] = "json";

$postfields["action"] = "addcontact";
$postfields["firstname"] = "Test";
$postfields["lastname"] = "User";
$postfields["email"] = "demo@whmcs.com";
$postfields["address1"] = "123 Demo Street";
$postfields["city"] = "Demo";
$postfields["state"] = "Florida";
$postfields["postcode"] = "AB123";
$postfields["country"] = "US";
$postfields["phonenumber"] = "123456789";

$result = mikrovps_SendCommand( $postfields );

Successful Response

result = success 
contactid =  xxx - the id of the new contact

Error Response

result=error
message= Client ID not found

Given Client ID is not found in the database.

result=error
message= Duplicate Email Address
Email address already exists in the database (when creating a sub-account)

Was this answer helpful?

« Back