editAccount

Edits an Account.

Top ↑

Syntax

bool editAccount( string api_key, array account_details );

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

account_details (array)

An associative array of Account details to be edited. See remarks below for a description of the values in the account_details array.

Return Value

Returns true on success.

Examples

$api = new Api($url, 'YOURAPIKEY');

// setup vars
$account_data = array(
    'id' => 12345,
    'company_name' => 'Example',
    'billing_email' => 'billing@example.com.au',
    'referal_code' => 'cvwg351',
    'company_adress' => '123 Stone St',
    'company_suburb' => 'Rock',
    'company_state' => 'QLD',
    'company_country' => 'Australia',
    'company_zip' => '1234',
    'company_industry' => 'Sales & Marketing',
    'website' => 'www.example.com.au',
    'branding' => 'example',
    'virtual_host' => 'virtual.host.example.com',
    'packages' => 33,
    'sub_packages' => 1,
    'contact_limit' => 10,
    'email_send_limit' => 30,
    'sms_send_limit' => 30,
    'send_cap' => 10,
    'expiry_time' => 1361772000,
    'account_type' => 1,
    'allow_login_to_under' => true,
    'allow_login_from_above' => true,
    'is_trial' => true,
    'is_free' => false
);

$return_ids = $api->invokeMethod('editAccount', $account_data);
{
   "id":1,
   "method":"editAccount",
   "params":[
      "YOURAPIKEY",
      {
         "id":12345,
         "company_name":"Example",
         "billing_email":"billing@example.com.au",
         "referal_code":"cvwg351",
         "company_adress":"123 Stone St",
         "company_suburb":"Rock",
         "company_state":"QLD",
         "company_country":"Australia",
         "company_zip":"1234",
         "company_industry":"Sales & Marketing",
         "website":"www.example.com.au",
         "branding":"example",
         "virtual_host":"virtual.host.example.com",
         "packages":33,
         "sub_packages":1,
         "contact_limit":10,
         "email_send_limit":30,
         "sms_send_limit":30,
         "send_cap":10,
         "expiry_time":1361772000,
         "account_type":1,
         "allow_login_to_under":true,
         "allow_login_from_above":true,
         "is_trial":true,
         "is_free":false
      }
   ]
}
{
    "id": 1,
    "result": true,
    "error": null
}

Remarks

The following table shows the structure of the account_details array.

Key Type Mandatory Description
id int Yes The ID of the account.
company_name string No The company name of the account.
billing_email string No The email address of the billing contact
referral_code string No The user referred code of the account
company_address string No The company address of the Account.
company_suburb string No The suburb of the company address.
company_state string No The state of the company address.
company_country string No The country of the company address.
company_zip string No The postcode of the company address.
company_industry string No The industry type of the company.
website string No The address of the company website.
account_type string No The Account type. Valid values are:
* single
* reseller
* partner
* corporate
branding string No The branding name.
virtual_host string No The host name of the virtual host.
packages string No The comma separated list of packages the Account has access to.
sub_packages string No The comma separated list of sub-packages the Account has access to.
contact_limit int No The maximum number of Contacts allowed in the Account.
email_send_limit int No The maximum number of Emails the Account can send per month.
sms_send_limit int No The maximum number of SMS Messages that the Account can send per month.
send_cap int No The maximum number of Emails that can be sent at one time. For trial Accounts the default of 10 is not editable.
expiry_time int No The the expiry time of the Account. For trial Accounts the default of 30 days is not editable.
allow_login_to_under bool No Whether the Account can log in to Accounts below it.
allow_login_from_above bool No Whether Accounts above this Account can log into it.
is_trial bool No Whether the Account is a trial Account. Trial Accounts can only create other trial Accounts.
is_free bool No Whether the Account is a free.
is_security_check_enabled bool No Whether or not to perform IP/host name checking of session requests (in addition to checking the user agent).

Error Codes

This method may return the following error codes in addition to the standard error codes:

Code Error Description
302 Undefined Method Error The Account cannot be edited currently. Please try again later.
310 Missing mandatory information Some of the required information in the Account data are missing.
317 Invalid Email Address Specified The Email address in the Account data is invalid.
321 Administrative access denied Either the Account does not exist, your Account does not have the Admin package, you are editing a sub-Account, or you are not editing your own Account.

See Also