Created
July 31, 2013 16:16
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ===================== | |
// 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