Created
July 31, 2013 16:29
-
-
Save callemall/6123633 to your computer and use it in GitHub Desktop.
Using the ExtCreateBroadcast function, this example creates and launches a broadcast that reuses the audio from a previous broadcast (request.messageID = 128342). It also demonstrates how to access Call-Em-All through a proxy.
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' | |
# If access to CEA is via proxy define the following and | |
# use as an option in the Client call | |
proxyOpts = dict() | |
proxyOpts['http'] = 'http://proxy.domain.com:3128' | |
client = Client(url, proxy=proxyOpts) | |
# Create a factory based on the WSDL | |
request = client.factory.create('ExtCreateBroadcastRequestType') | |
# Setup the factory based on the WSDL specs | |
request.username = 99919991 | |
request.pin = 9991 | |
request.broadcastType = 1 | |
request.phoneNumberSource = 3 | |
request.broadcastName = "Sample Create broadcast" | |
request.messageID = 128342 # -- Refers to an existing broadcast | |
request.launchDateTime = "6/1/2011 05:00 PM" | |
request.commaDelimitedPhoneNumbers = "9725551212,9725551313" | |
result = client.service.ExtCreateBroadcast(request) | |
if result.errorCode > 0: | |
print result.errorMessage | |
else: | |
print "Broadcast Created Successfully" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment