Skip to content

Instantly share code, notes, and snippets.

@callemall
Created July 31, 2013 16:34
Show Gist options
  • Save callemall/6123689 to your computer and use it in GitHub Desktop.
Save callemall/6123689 to your computer and use it in GitHub Desktop.
The code below uses the API's ExtCreateBroadcast function to generate a broadcast. The broadcast uses audio from a previous broadcast by putting the broadcast's ID in the MessageID variable (IN_MessageID = "442499").
Partial Class SendBroadcast
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
' Use this for Production
' Dim urlstring As String = "http://API.call-em-all.com/Webservices/CEAAPI_v2.asmx"
' Use this for Testing
Dim urlstring As String = "http://staging-API.call-em-all.com/Webservices/CEAAPI_v2.asmx"
Dim IN_BroadcastName As String = "My Broadcast Name"
Dim IN_CallerID As String = "9725551212"
Dim IN_MessageID As String = "442499"
Dim IN_Username As String = "99919991"
Dim IN_Pin As String = "9991"
Dim IN_PhoneNumbers As String = "9728411313,8005551212"
Dim p As com.call_em_all.api.CEAAPI_v2 = New com.call_em_all.api.CEAAPI_v2
p.Url = urlstring
Dim R As com.call_em_all.api.ExtCreateBroadcastRequestType = New com.call_em_all.api.ExtCreateBroadcastRequestType
Dim A As com.call_em_all.api.ExtCreateBroadcastResponseType = New com.call_em_all.api.ExtCreateBroadcastResponseType
R.broadcastType = 1 ' 1=Announcement; 2=Survey
R.checkCallingWindow = 0 ' Default=1; 0=Bypass calling window check; 1=Enforce calling window check;
R.broadcastName = IN_BroadcastName
R.callerID = IN_CallerID
R.messageID = IN_MessageID
R.username = IN_Username
R.pin = IN_Pin
R.phoneNumberSource = 3 ' 1=List; 2=CSV; 3=CommaDelimitedPhoneNumbers;
R.commaDelimitedPhoneNumbers = IN_PhoneNumbers
' ============================================
' R.launchDateTime = "12/25/2014 08:00:00 AM"
' ============================================
' Default=current date and time;
' The date and time to launch the broadcast in
' MM/DD/YYYY HH:MM AM/PM format
A = p.ExtCreateBroadcast(R)
If A.errorCode <> 0 Then
Response.Write("The error was : " + A.errorMessage.ToString)
Else
Response.Write("Success")
' Data Available after successfull call
' =====================================
' A.broadcastID - The created broadcastID (can be used later to pull results)
' A.badRecordCountOnFile - Results of the import of phonenumbers types 2,3
' A.duplicateRecrodCountOnFile - Any duplicate numbers
' A.goodRecordCountOnFile - Total good records
' A.tollFreeNumber - If you do not specify a messageID, call this number to record message
' A.messageRecordingID - use this recording ID when you call to record
End If
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment