get_space()

Get storage usage.

Without optional parameters, the function returns the statistics of the account.

Signature

get_space(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
show_subaccounts Show only the storage of the subaccounts Optional Default: N
show_details Details about the storage usage, including mailboxes and databases Optional Default: N

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'show_subaccounts' => 'Y',
    'show_details' => 'N',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'get_space',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • array_return array with information about the used storage (in kilobytes)