Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This example uses the CheckAccount function to retrieve basic information and settings of an account including its status, the available call balance, and most of the settings seen on the "My Account" tab when logged in to a Call-Em-All account.
// =====================
// account information
// =====================
$username = "999111999";
$pin = "9991";
$proxy = "http://staging-api.call-em-all.com/webservices/ceaapi_v2.asmx?WSDL";
$client = new SoapClient($proxy, array("trace" => true));
$request = array (
"username" => $username,
"pin" => $pin,
);
$response = $client->CheckAccount(array("myRequest" => $request));
// =====================
// var_dump($response);
// =====================
print "errorCode :" . $response->CheckAccountResult->errorCode . "\n";
print "errorMessage :" . $response->CheckAccountResult->errorMessage . "\n";
if ( $response->CheckAccountResult->errorCode === 0)
{
print "accountStatus :" . $response->CheckAccountResult->accountStatus . "\n";
print "StatusDescription :" . $response->CheckAccountResult->accountStatusDescription . "\n";
print "CallBalance :" . $response->CheckAccountResult->CallBalance . "\n";
print "PendingCallBalance :" . $response->CheckAccountResult->PendingCallBalance . "\n";
print "AvailableCallUnits :" . $response->CheckAccountResult->AvailableCallUnits . "\n";
}
function IsNullOrEmptyString($question) {
return (!isset($question) || trim($question)==='');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.