Service: GetAccounts

The GetAccounts service allows you to get a list of all agency sub-accounts.

Service Details

SOAP Action: GetAccounts
SOAP Return Object: GetAccountsResp

Input

The following table describes the parameters used for calling the GetAccounts service.

Table: instance of GetAccountsReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication

Output

The following table describes the parameters returned from the GetAccounts service.

Table: instance of GetAccountsResp

Parameter Mandatory Type Description
header / APIResponseHeader Header containing authentication information
errorCode / Integer Numerical value of the error
errorMessage / String Short literal description of the error
accountTypeItems / Array of AccountType An array of AccountType items

Table: response codes of GetAccountsResp.

0 No error
220 Authentication error, see header object for detailed information

Example

Print a list of all agency sub-accounts

<?php

// create header object
$header = new stdClass();
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

$request = new stdClass();
$request->header = $header;

$response = $SoapClient->__soapCall("GetAccounts", array($request));

if ($response->errorCode == 0) {
    foreach ($response->accountTypeItems as $account) {
        echo $account->userId . " - " . $account->company . "<br />";
    }
} else {
    echo "GetAccounts failed: " . $response->errorMessage;
}

?>