getAccountById

Returns details for a specific Account.

getAccountById

Returns details for a specific Account.

Top ↑

Syntax

array getAccountById ( string api_key, int account_id );

Parameters

api_key (string)

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

account_id (int)

The ID of the Account to retrieve.

Return Value

Returns an array containing a single associative array of Account details. See searchAccounts for a description of the values returned.

Examples

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

$return_ids = $api->invokeMethod('getAccountById', $account_id);
{
    "id": 1,
    "method": "getAccountById",
    "params": [
        "YOURAPIKEY",
        12345
    ]
}
{
    "id": 1,
    "result": [
        {
            "id": 12345,
            "account_type": "single",
            "account_status": "ok",
            "packages": "home,em,account,knowledge_centre",
            "sub_packages": "sms,conditional_content,social,dallas,new_ui,chalice",
            "parent_account_id": 6,
            "creation_time": 1358820452,
            "last_modified_time": 1358820452,
            "expiry_time": 0,
            "company_name": "ideal4",
            "company_address": "",
            "company_suburb": "",
            "company_state": "",
            "company_country": "Australia",
            "company_zip": "",
            "company_industry": "Other",
            "website": "",
            "business_registration_number": "",
            "billing_email": "",
            "balance": "0.00",
            "is_trial": 0,
            "is_free": 0,
            "is_deactivated": 0,
            "is_expired": 0,
            "trial_activation_time": 0,
            "trial_activation_method": "none",
            "trial_email_opened": 0,
            "trial_renewal_time": 0,
            "trial_renewal_count": 0,
            "allow_login_to_under": 1,
            "allow_login_from_above": 1,
            "is_security_check_enabled": 1,
            "campaign_code": "",
            "trial_sms_code": "",
            "send_cap": 0,
            "contact_limit": 0,
            "owner_user_id": 12345,
            "owner_username": "ideal4",
            "owner_first_name": "ideal4",
            "owner_last_name": "willdo",
            "owner_name": "ideal4 willdo",
            "owner_email": "owner@example.com",
            "owner_phone": "0414288934",
            "owner_mobile": "",
            "owner_fax": "",
            "owner_timezone": "Australia\/Brisbane",
            "branding": "example",
            "virtual_host": "www.example.com.au"
        }
    ],
    "error": null
}

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 saved. Please try again later.
310 Missing mandatory information Some of the required information in the Account data and/or the User data are missing.
328 Could not load Account System cannot find the Account you are trying to edit.

See Also