Skip to content

Instantly share code, notes, and snippets.

@callemall
Created July 31, 2013 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callemall/6123508 to your computer and use it in GitHub Desktop.
Save callemall/6123508 to your computer and use it in GitHub Desktop.
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