Last active
December 24, 2015 22:39
-
-
Save callemall/6874875 to your computer and use it in GitHub Desktop.
An example class that executes the Call-Em-All API function ExtCreateBroadcast to launch a text-to-speech voice broadcast.
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
import java.net.URL; | |
import java.rmi.RemoteException; | |
import javax.xml.rpc.ServiceException; | |
import java.net.MalformedURLException; | |
import com.call_em_all.CEAAPI_v3_BetaLocator; | |
import com.call_em_all.CEAAPI_v3_BetaSoap; | |
public class Demo { | |
Demo(){ | |
try | |
{ | |
URL url = new URL("http://staging-api.call-em-all.com/WebServices/CEAAPI_V3-Beta.asmx"); | |
CEAAPI_v3_BetaLocator apilocator = new CEAAPI_v3_BetaLocator(); | |
CEAAPI_v3_BetaSoap api = apilocator.getCEAAPI_v3_BetaSoap(url); | |
com.call_em_all.ExtCreateBroadcastRequestType request = new com.call_em_all.ExtCreateBroadcastRequestType(); | |
request.setUsername("......."); | |
request.setPin("......"); | |
request.setCallerID("........."); | |
request.setCommaDelimitedPhoneNumbers("..........."); | |
request.setBroadcastName("Demo"); | |
request.setBroadcastType("1"); //announcement | |
request.setCheckCallingWindow("1"); // yes | |
request.setPhoneNumberSource("3"); // // delimited phone number list | |
request.setTTSText("This is a text to speech demo message played when someone answers the phone. 1 2 3 4 5 6 7 8 9 10. Goodbye"); | |
request.setTTSTextVM("This is a text to speech demo message played when answering machine is detected. 1 2 3 4 5 6 7 8 9 10. Goodbye"); | |
com.call_em_all.ExtCreateBroadcastResponseType response = api.extCreateBroadcast(request); | |
int x = 0; | |
} catch (ServiceException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} catch (RemoteException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} catch (MalformedURLException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
new Demo(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment