Created
July 31, 2013 16:26
-
-
Save callemall/6123617 to your computer and use it in GitHub Desktop.
This example uses the CheckAccount function to retrieve some basic information and settings on an account including its status, the available call balance, and other 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
#!/usr/bin/python | |
# The suds SOAP client is not included in the default Python | |
# distribution and must be installed manually either by manual | |
# download or easy_install. | |
from suds.client import Client | |
url = 'http://staging-api.call-em-all.com/webservices/ceaapi_v2.asmx?wsdl' | |
client = Client(url) | |
request = client.factory.create('CheckAccountRequestType') | |
request.username = '999111999' | |
request.pin = '9991' | |
response = client.service.CheckAccount(request) | |
print "ErrorCode :", response.errorCode | |
print "ErrorMessage :", response.errorMessage | |
if response.errorCode == 0: | |
print "AccountStatus :", response.accountStatus | |
print "Status Descr. :", response.accountStatusDescription | |
print "Call Balance :", response.CallBalance | |
print "Pending Balance :", response.PendingCallBalance | |
print "Available Bal :", response.AvailableCallUnits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment