com.telapi.api
Class TelapiConnector

java.lang.Object
  extended by com.telapi.api.TelapiConnector

public class TelapiConnector
extends Object

The class used for all forms of communication with the Telapi REST API.


Constructor Summary
TelapiConnector(TelapiConfiguration conf)
          Creates a new TelapiConnector based on the provided configuration.
 
Method Summary
 IncomingPhoneNumber addIncomingPhoneNumber(String phoneNumber, String areaCode)
          TelAPI incoming phone numbers can be added or removed from an account through our REST API.
 IncomingPhoneNumber addIncomingPhoneNumber(String accountSid, String phoneNumber, String areaCode)
           
 FraudList authorizeDestination(String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
          Used to authorize previously blocked destinations for outbound calls and sms messages.
 FraudList authorizeDestination(String accountSid, String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
           
 FraudList blockDestination(String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
          TelAPI will restrict outbound calls and sms messages to blocked destinations.
 FraudList blockDestination(String accountSid, String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
           
 CarrierLookupList carrierLookup(List<String> phoneNumber)
          Provides a way to look up the carrier of phone numbers.
 CarrierLookupList carrierLookup(String phoneNumber)
          Provides a way to look up the carrier of a phone number.
 CarrierLookupList carrierLookup(String accountSid, List<String> phoneNumber)
           
 CarrierLookupList carrierLookup(String accountSid, String phoneNumber)
           
 CnamDipList cnamLookup(List<String> phoneNumbers)
          Performs a CNAM lookup for multiple phone numbers.
 CnamDipList cnamLookup(String phoneNumber)
          Performs a CNAM lookup for a phone number.
 CnamDipList cnamLookup(String accountSid, List<String> phoneNumbers)
           
 CnamDipList cnamLookup(String accountSid, String phoneNumber)
           
 Application createApplication(ApplicationRequest applicationRequest)
           
 Application createApplication(String friendlyName, String voiceUrl, HttpMethod voiceMethod, String voiceFallbackUrl, HttpMethod voiceFallbackMethod, Boolean voiceCallerIdLookup, String smsUrl, HttpMethod smsMethod, String smsFallbackUrl, HttpMethod smsFallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod, String hangupCallback, HttpMethod hangupCallbackMethod)
          Creates a new application for managing TelAPI phone numbers,
 Application createApplication(String accountSid, String friendlyName, String voiceUrl, HttpMethod voiceMethod, String voiceFallbackUrl, HttpMethod voiceFallbackMethod, Boolean voiceCallerIdLookup, String smsUrl, HttpMethod smsMethod, String smsFallbackUrl, HttpMethod smsFallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod, String hangupCallback, HttpMethod hangupCallbackMethod)
           
 Participant deafOrMuteParticipant(String conferenceSid, String callSid, Boolean muted, Boolean deaf)
          Conference participants can be muted or deafed by calling this method.
 Participant deafOrMuteParticipant(String accountSid, String conferenceSid, String callSid, Boolean muted, Boolean deaf)
           
 Application deleteApplication(String applicationSid)
          Deletes an existing application.
 Application deleteApplication(String accountSid, String applicationSid)
           
 IncomingPhoneNumber deleteIncomingPhoneNumber(String incomingPhoneNumberSid)
          Deletes an IncomingPhoneNumber from your account.
 IncomingPhoneNumber deleteIncomingPhoneNumber(String accountSid, String incomingPhoneNumberSid)
           
 FraudList extendDestinationAuth(String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
          By default, authorized destinations will expire and return to fully blocked status after 30 days.
 FraudList extendDestinationAuth(String accountSid, String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
           
 String getRecordingUrl(String recordingSid)
          Gets the URL of the audio file containing the recording.
 String getRecordingUrl(String accountSid, String recordingSid)
           
 Call hangUpCall(String callSid)
          Hangs up a call.
 Call hangUpCall(String accountSid, String callSid)
           
 Participant hangupParticipant(String conferenceSid, String callSid)
          Hangup conference members by conference sid and call sid.
 Participant hangupParticipant(String accountSid, String conferenceSid, String callSid)
           
 ApplicationList listApplications()
          Used to get a list of all application resources associated with a given account.
 ApplicationList listApplications(String friendlyName, Long page, Long pageSize)
          Used to get a list of application resources associated with a given account.
 ApplicationList listApplications(String accountSid, String friendlyName, Long page, Long pageSize)
           
 AvailablePhoneNumberList listAvailablePhoneNumbers(String isoCountryCode, String areaCode, String contains, String inRegion, String inPostalCode, Long page, Long pageSize)
          If you want to add a new TelAPI number, you need to know what ones are available.
 AvailablePhoneNumberList listAvailablePhoneNumbers(String accountSid, String isoCountryCode, String areaCode, String contains, String inRegion, String inPostalCode, Long page, Long pageSize)
           
 NotificationList listCallNotifications(String callSid, LogLevel log, Long page, Long pageSize)
          Returns a list of notifications associated with a certain Call.
 NotificationList listCallNotifications(String accountSid, String callSid, LogLevel log, Long page, Long pageSize)
           
 RecordingList listCallRecordings(String callSid, Date dateCreatedGte, Date dateCreatedLt, Long page, Long pageSize)
          Gets a list of Recordings which belong to a specified Call.
 RecordingList listCallRecordings(String accountSid, String callSid, Date dateCreatedGte, Date dateCreatedLt, Long page, Long pageSize)
           
 CallList listCalls()
          To view a list of all inbound and outbound call resources associated with a given account, use this method.
 CallList listCalls(String to, String from, CallStatus status, Date startTimeGte, Date startTimeLt, Long page, Long pageSize)
          To view a list of all inbound and outbound call resources associated with a given account, use this method.
 CallList listCalls(String accountSid, String to, String from, CallStatus status, Date startTimeGte, Date startTimeLt, Long page, Long pageSize)
           
 ConferenceList listConferences()
          To view a list of all conference resources associated with a given account, the URI below is provided.
 ConferenceList listConferences(String friendlyName, String status, Date dateCreatedGte, Date dateCreatedLt, Date dateUpdatedGte, Date dateUpdatedLt, Long page, Long pageSize)
          To view a list of all conference resources associated with a given account, the URI below is provided.
 ConferenceList listConferences(String accountSid, String friendlyName, String status, Date dateCreatedGte, Date dateCreatedLt, Date dateUpdatedGte, Date dateUpdatedLt, Long page, Long pageSize)
           
 FraudList listFraudControlResources()
          Gets a list of Fraud control resources for a certain account.
 FraudList listFraudControlResources(Long page, Long pageSize)
          Gets a list of Fraud control resources for a certain account.
 FraudList listFraudControlResources(String accountSid, Long page, Long pageSize)
           
 IncomingPhoneNumberList listIncomingPhoneNumbers()
          Retrieves a list of all incoming phone number resources associated with a given account.
 IncomingPhoneNumberList listIncomingPhoneNumbers(String phoneNumber, String friendlyName, Long page, Long pageSize)
          Retrieves a list of incoming phone number resources associated with a given account.
 IncomingPhoneNumberList listIncomingPhoneNumbers(String accountSid, String phoneNumber, String friendlyName, Long page, Long pageSize)
           
 NotificationList listNotifications()
          Returns a list of all notifications associated with the account.
 NotificationList listNotifications(LogLevel log, Long page, Long pageSize)
          Returns a list of notifications associated with the account.
 NotificationList listNotifications(String accountSid, LogLevel log, Long page, Long pageSize)
           
 List<Participant> listParticipants(String conferenceSid)
          Convenience method.
 List<Participant> listParticipants(String conferenceSid, Boolean muted, Boolean deaf, Long page, Long pageSize)
          Used to get a list of participants currently connected to a particular conference.
 List<Participant> listParticipants(String accountSid, String conferenceSid, Boolean muted, Boolean deaf, Long page, Long pageSize)
           
 RecordingList listRecordings()
          Gets a list of all Recordings.
 RecordingList listRecordings(Date dateCreatedGte, Date dateCreatedLt, Long page, Long pageSize)
          Gets a list of Recordings.
 RecordingList listRecordings(String accountSid, Date dateCreatedGte, Date dateCreatedLt, Long page, Long pageSize)
           
 TranscriptionList listRecordingTranscriptions(String accountSid, String recordingSid, TranscriptionStatus status, Date dateTranscribedGte, Date dateTranscribedLt, Long page, Long pageSize)
           
 TranscriptionList listRecordingTranscriptions(String recordingSid, TranscriptionStatus status, Date dateTranscribedGte, Date dateTranscribedLt, Long page, Long pageSize)
          Lists all the transcriptions belonging to an account.
 SmsMessageList listSmsMessages()
          Lists all Sms Messages for the configured account.
 SmsMessageList listSmsMessages(String to, String from, Date dateSentGte, Date dateSentLt, Long page, Long pageSize)
          Just as with calls, a list of all messages sent to and from a given TelAPI account's phone numbers can be requested via our REST API.
 SmsMessageList listSmsMessages(String accountSid, String to, String from, Date dateSentGte, Date dateSentLt, Long page, Long pageSize)
           
 TranscriptionList listTranscriptions()
          Lists all the transcriptions belonging to an account.
 TranscriptionList listTranscriptions(String accountSid, TranscriptionStatus status, Date dateTranscribedGte, Date dateTranscribedLt, Long page, Long pageSize)
           
 TranscriptionList listTranscriptions(TranscriptionStatus status, Date dateTranscribedGte, Date dateTranscribedLt, Long page, Long pageSize)
          Lists transcriptions belonging to an account.
 Call makeCall(CallRequest callRequest)
          Convenience method which accepts a CallRequest object containing parameters.
 Call makeCall(String to, String from, String url, HttpMethod method, String fallbackUrl, HttpMethod fallbackMethod, String statusCallback, HttpMethod statusCallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod, String forwardedFrom, String sendDigits, Long timeout, Boolean hideCallerId, Boolean record, String recordCallback, HttpMethod recordCallbackMethod, Boolean transcribe, String transcribeCallback, HttpMethod transcribeCallbackMethod)
          Makes a call.
 Call makeCall(String accountSid, String to, String from, String url, HttpMethod method, String fallbackUrl, HttpMethod fallbackMethod, String statusCallback, HttpMethod statusCallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod, String forwardedFrom, String sendDigits, Long timeout, Boolean hideCallerId, Boolean record, String recordCallback, HttpMethod recordCallbackMethod, Boolean transcribe, String transcribeCallback, HttpMethod transcribeCallbackMethod)
           
 Call playAudioToCall(String callSid, String soundsUrl)
          TelAPI allows you to play an audio file during a call.
 Call playAudioToCall(String callSid, String soundsUrl, Long length, Legs legs, Boolean loop, Boolean mix)
          TelAPI allows you to play an audio file during a call.
 Call playAudioToCall(String accountSid, String callSid, String soundsUrl, Long length, Legs legs, Boolean loop, Boolean mix)
           
 Participant playAudioToParticipant(String conferenceSid, String callSid, String audioUrl)
          Pre-recorded sound from a file can be played to conference members.
 Participant playAudioToParticipant(String accountSid, String conferenceSid, String callSid, String url)
           
 RecordingList recordCall(String callSid, Boolean record, Long timeLimit, String callbackUrl)
          TelAPI offers a way to both initiate or end a call recording.
 RecordingList recordCall(String accountSid, String callSid, Boolean record, Long timeLimit, String callbackUrl)
           
 Call sendDigits(String callSid, String playDtfm, Legs dtmfLeg)
          DTMFs, aka touch tone signals, can be sent to a call.
 Call sendDigits(String accountSid, String callSid, String playDtfm, Legs dtmfLeg)
           
 SmsMessage sendSmsMessage(String to, String from, String body, String statusCallback)
          Sends an SMS message.
 SmsMessage sendSmsMessage(String accountSid, String to, String from, String body, String statusCallback)
           
 Transcription transcribeAudioUrl(String audioUrl, String transcribeCallback, HttpMethod callbackMethod, TranscriptionType quality)
          Transcribes audio found on an URL.
 Transcription transcribeAudioUrl(String accountSid, String audioUrl, String transcribeCallback, HttpMethod callbackMethod, TranscriptionType quality)
           
 Transcription transcribeRecording(String recordingSid, String transcribeCallback, HttpMethod callbackMethod, TranscriptionType quality)
          Transcribes a recording.
 Transcription transcribeRecording(String accountSid, String recordingSid, String transcribeCallback, HttpMethod callbackMethod, TranscriptionType quality)
           
 Application updateApplication(ApplicationRequest applicationRequest)
           
 Application updateApplication(String applicationSid, String friendlyName, String voiceUrl, HttpMethod voiceMethod, String voiceFallbackUrl, HttpMethod voiceFallbackMethod, Boolean voiceCallerIdLookup, String smsUrl, HttpMethod smsMethod, String smsFallbackUrl, HttpMethod smsFallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod, String hangupCallback, HttpMethod hangupCallbackMethod)
          Used to update an existing application.
 Application updateApplication(String accountSid, String applicationSid, String friendlyName, String voiceUrl, HttpMethod voiceMethod, String voiceFallbackUrl, HttpMethod voiceFallbackMethod, Boolean voiceCallerIdLookup, String smsUrl, HttpMethod smsMethod, String smsFallbackUrl, HttpMethod smsFallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod, String hangupCallback, HttpMethod hangupCallbackMethod)
           
 IncomingPhoneNumber updateIncomingPhoneNumber(IncomingPhoneNumberRequest ipnRequest)
           
 IncomingPhoneNumber updateIncomingPhoneNumber(String incomingPhoneNumberSid, String friendlyName, String voiceUrl, HttpMethod voiceMethod, String voiceFallbackUrl, HttpMethod voiceFallbackMethod, Boolean voiceCallerIdLookup, String smsUrl, HttpMethod smsMethod, String smsFallbackUrl, HttpMethod smsFallbackMethod, String hangupCallback, HttpMethod hangupCallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod)
          Updates properties of an IncomingPhoneNumber.
 IncomingPhoneNumber updateIncomingPhoneNumber(String accountSid, String incomingPhoneNumberSid, String friendlyName, String voiceUrl, HttpMethod voiceMethod, String voiceFallbackUrl, HttpMethod voiceFallbackMethod, Boolean voiceCallerIdLookup, String smsUrl, HttpMethod smsMethod, String smsFallbackUrl, HttpMethod smsFallbackMethod, String hangupCallback, HttpMethod hangupCallbackMethod, String heartbeatUrl, HttpMethod heartbeatMethod)
           
 Account viewAccount()
           
 Account viewAccount(String accountSid)
          An account resource provides information about a single TelAPI account.
 AccountsList viewAccounts()
           
 Application viewApplication(String applicationSid)
          TelAPI offers the ability to preset all voice and sms urls for a given application name.
 Application viewApplication(String accountSid, String applicationSid)
           
 Call viewCall(String callSid)
          Gets the specified call resource.
 Call viewCall(String accountSid, String callSid)
           
 Conference viewConference(String conferenceSid)
          Resource properties about conference calls that occurred through a TelAPI account can be requested using our API.
 Conference viewConference(String accountSid, String conferenceSid)
           
 IncomingPhoneNumber viewIncomingPhoneNumber(String incomingPhoneNumberSid)
          TelAPI phone numbers associated with an account are represented with the IncomingPhoneNumber resource.
 IncomingPhoneNumber viewIncomingPhoneNumber(String accountSid, String incomingPhoneNumberSid)
           
 Notification viewNotification(String notificationSid)
          Retrieves details about a Notification.
 Notification viewNotification(String accountSid, String notificationSid)
           
 Participant viewParticipant(String conferenceSid, String callSid)
          Participants of a conference are identified by the CallSid created when they dial into the conference.
 Participant viewParticipant(String accountSid, String conferenceSid, String callSid)
           
 Recording viewRecording(String recordingSid)
          A single recording details can be viewed by calling this method.
 Recording viewRecording(String accountSid, String recordingSid)
           
 SmsMessage viewSmsMessage(String smsMessageSid)
          Text messages sent to and from TelAPI phone numbers are represented with the Sms resource.
 SmsMessage viewSmsMessage(String sid, String smsMessageSid)
          Used for specifying a different accountSid.
 Transcription viewTranscription(String transcriptionSid)
          Gets the details of a Transcription resource.
 Transcription viewTranscription(String accountSid, String transcriptionSid)
           
 String viewTranscriptionText(String transcriptionSid)
          Gets just the transcription text of a Transcription.
 String viewTranscriptionText(String accountSid, String transcriptionSid)
           
 Call voiceEffects(String callSid, AudioDirection audioDirection, Double pitch, Long pitchSemiTones, Long pitchOctaves, Double rate)
          With TelAPI you can modify the way a callers voice sounds by changing things such as speed and pitch of the audio.
 Call voiceEffects(String accountSid, String callSid, AudioDirection audioDirection, Double pitch, Long pitchSemiTones, Long pitchOctaves, Double rate)
           
 FraudList whitelistDestination(String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
          Whitelisting is provided for destinations you wish to permanently authorize.
 FraudList whitelistDestination(String accountSid, String countryCode, Boolean mobileEnabled, Boolean landlineEnabled, Boolean smsEnabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelapiConnector

public TelapiConnector(TelapiConfiguration conf)
Creates a new TelapiConnector based on the provided configuration.

Parameters:
conf - The configuration based on which the TelapiConnector will be created.
See Also:
BasicTelapiConfiguration, PropertiesFileTelapiConfiguration, TelapiConfiguration
Method Detail

viewAccount

public Account viewAccount(String accountSid)
                    throws TelapiException
An account resource provides information about a single TelAPI account. This methods gets the info of the account with the provided Sid.

Parameters:
accountSid -
Returns:
Throws:
TelapiException

viewAccount

public Account viewAccount()
                    throws TelapiException
Returns:
The account with the Sid defined in the configuration.
Throws:
TelapiException
See Also:
viewAccount(String)

viewAccounts

public AccountsList viewAccounts()
                          throws TelapiException
Throws:
TelapiException

viewSmsMessage

public SmsMessage viewSmsMessage(String sid,
                                 String smsMessageSid)
                          throws TelapiException
Used for specifying a different accountSid.

Parameters:
sid - The account sid (required).
Returns:
An Sms Message resource.
Throws:
TelapiException
See Also:
viewSmsMessage(String)

viewSmsMessage

public SmsMessage viewSmsMessage(String smsMessageSid)
                          throws TelapiException
Text messages sent to and from TelAPI phone numbers are represented with the Sms resource.

Parameters:
smsMessageSid - The sms message sid (required).
Returns:
An Sms Message resource.
Throws:
TelapiException

listSmsMessages

public SmsMessageList listSmsMessages(String accountSid,
                                      String to,
                                      String from,
                                      Date dateSentGte,
                                      Date dateSentLt,
                                      Long page,
                                      Long pageSize)
                               throws TelapiException
Parameters:
accountSid - The account sid (required).
Returns:
A list of SmsMessage resources.
Throws:
TelapiException
See Also:
listSmsMessages(String, String, Date, Date, Long, Long)

listSmsMessages

public SmsMessageList listSmsMessages(String to,
                                      String from,
                                      Date dateSentGte,
                                      Date dateSentLt,
                                      Long page,
                                      Long pageSize)
                               throws TelapiException
Just as with calls, a list of all messages sent to and from a given TelAPI account's phone numbers can be requested via our REST API.

Parameters:
to - Lists all SMS messages sent to this number.
from - Lists all SMS messages sent from this number.
dateSentGte - Lists all SMS messages beginning on or from a certain date.
dateSentLt - Lists all SMS messages before a certain date.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of SmsMessage resources.
Throws:
TelapiException

listSmsMessages

public SmsMessageList listSmsMessages()
                               throws TelapiException
Lists all Sms Messages for the configured account.

Returns:
A list of Sms Message.
Throws:
TelapiException

sendSmsMessage

public SmsMessage sendSmsMessage(String accountSid,
                                 String to,
                                 String from,
                                 String body,
                                 String statusCallback)
                          throws TelapiException
Parameters:
accountSid - The account sid (required).
Throws:
TelapiException
See Also:
sendSmsMessage(String, String, String, String)

sendSmsMessage

public SmsMessage sendSmsMessage(String to,
                                 String from,
                                 String body,
                                 String statusCallback)
                          throws TelapiException
Sends an SMS message.

Parameters:
to - The number you want to send the SMS to (required).
from - The number you want to display as sending the SMS. A subcharge will apply when sending via a custom From number (required).
body - Text of the SMS message to be sent. Plain text up to 160 characters in length (required).
statusCallback - URL that a set of default parameters will be forwarded to once the SMS is complete.
Returns:
The SMS message which was sent.
Throws:
TelapiException

viewCall

public Call viewCall(String accountSid,
                     String callSid)
              throws TelapiException
Parameters:
accountSid - The account sid (required).
Throws:
TelapiException
See Also:
viewCall(String)

viewCall

public Call viewCall(String callSid)
              throws TelapiException
Gets the specified call resource. A call resource provides information about an individual call that has occurred through TelAPI. Both inbound and outbound voice communication through TelAPI are categorized as calls.

Parameters:
callSid - The sid of the requested Call resource (required).
Returns:
The requested Call resource.
Throws:
TelapiException

listCalls

public CallList listCalls(String accountSid,
                          String to,
                          String from,
                          CallStatus status,
                          Date startTimeGte,
                          Date startTimeLt,
                          Long page,
                          Long pageSize)
                   throws TelapiException
Parameters:
accountSid - The account sid (required).
Throws:
TelapiException
See Also:
listCalls(String, String, CallStatus, Date, Date, Long, Long)

listCalls

public CallList listCalls(String to,
                          String from,
                          CallStatus status,
                          Date startTimeGte,
                          Date startTimeLt,
                          Long page,
                          Long pageSize)
                   throws TelapiException
To view a list of all inbound and outbound call resources associated with a given account, use this method. The response returned lists the calls in chronological order and also includes paging information.

Parameters:
to - Lists all calls made to this number only.
from - Lists all calls made from this number.
status - Lists all calls with the specified status only.
startTimeGte - Lists all calls beginning on or from a certain date.
startTimeLt - Lists all calls beginning before a certain date.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of calls.
Throws:
TelapiException

listCalls

public CallList listCalls()
                   throws TelapiException
To view a list of all inbound and outbound call resources associated with a given account, use this method. The response returned lists the calls in chronological order and also includes paging information.

Returns:
A list of calls.
Throws:
TelapiException

makeCall

public Call makeCall(String accountSid,
                     String to,
                     String from,
                     String url,
                     HttpMethod method,
                     String fallbackUrl,
                     HttpMethod fallbackMethod,
                     String statusCallback,
                     HttpMethod statusCallbackMethod,
                     String heartbeatUrl,
                     HttpMethod heartbeatMethod,
                     String forwardedFrom,
                     String sendDigits,
                     Long timeout,
                     Boolean hideCallerId,
                     Boolean record,
                     String recordCallback,
                     HttpMethod recordCallbackMethod,
                     Boolean transcribe,
                     String transcribeCallback,
                     HttpMethod transcribeCallbackMethod)
              throws TelapiException
Throws:
TelapiException
See Also:
makeCall(String, String, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, String, Long, Boolean, Boolean, String, HttpMethod, Boolean, String, HttpMethod)

makeCall

public Call makeCall(String to,
                     String from,
                     String url,
                     HttpMethod method,
                     String fallbackUrl,
                     HttpMethod fallbackMethod,
                     String statusCallback,
                     HttpMethod statusCallbackMethod,
                     String heartbeatUrl,
                     HttpMethod heartbeatMethod,
                     String forwardedFrom,
                     String sendDigits,
                     Long timeout,
                     Boolean hideCallerId,
                     Boolean record,
                     String recordCallback,
                     HttpMethod recordCallbackMethod,
                     Boolean transcribe,
                     String transcribeCallback,
                     HttpMethod transcribeCallbackMethod)
              throws TelapiException
Makes a call.

Parameters:
to - The number to call (required).
from - The number to display as calling (required).
url - The URL requested once the call connects. A set of default parameters will be sent here.
method - Specifies the HTTP method used to request the required URL once call connects. Defaults to POST.
fallbackUrl - URL used if any errors occur during execution of InboundXML or at initial request of the required Url provided with the POST.
fallbackMethod - Specifies the HTTP method used to request FallbackUrl. Defaults to POST.
statusCallback - URL that can be requested to receive notification when call has ended. A set of default parameters will be sent here once the call is finished.
statusCallbackMethod - Specifies the HTTP method used to request StatusCallbackUrl. Defaults to POST.
heartbeatUrl - URL that can be requested every 60 seconds during the call to notify of elapsed time and pass other general information.
heartbeatMethod - Specifies the HTTP method used to request the Heartbeat URL.
forwardedFrom - Specifies the forwarding number to pass to the receiving carrier.
sendDigits - Dials digits once call connects. Can be used to forward callers to different extensions or numbers. Allowed values are numbers, # and *.
timeout - Number of seconds call stays on the line while waiting for an answer. The max time limit is 999 and the default limit is 60 seconds but lower times can be set. Defaults to 60.
hideCallerId - Specifies if the caller id will be hidden.
record - Specifies whether this call should be recorded. Defaults to false.
recordCallback - A URL some parameters regarding the recording will be past to once it is completed.
recordCallbackMethod - Method used to request the RecordCallback URL.
transcribe - Specifies whether this call should be transcribed. Defaults to false.
transcribeCallback - A URL some parameters regarding the transcription will be past to once it is completed.
transcribeCallbackMethod - Method used to request the TranscribeCallback URL.
Returns:
The newly made call.
Throws:
TelapiException

makeCall

public Call makeCall(CallRequest callRequest)
              throws TelapiException
Convenience method which accepts a CallRequest object containing parameters.

Returns:
The newly made call.
Throws:
TelapiException
See Also:
makeCall(String, String, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, String, Long, Boolean, Boolean, String, HttpMethod, Boolean, String, HttpMethod)

hangUpCall

public Call hangUpCall(String accountSid,
                       String callSid)
                throws TelapiException
Throws:
TelapiException
See Also:
hangUpCall(String)

hangUpCall

public Call hangUpCall(String callSid)
                throws TelapiException
Hangs up a call.

Parameters:
callSid - The sid of the Call to hang up.
Returns:
The hung up call.
Throws:
TelapiException

sendDigits

public Call sendDigits(String accountSid,
                       String callSid,
                       String playDtfm,
                       Legs dtmfLeg)
                throws TelapiException
Throws:
TelapiException
See Also:
sendDigits(String, String, Legs)

sendDigits

public Call sendDigits(String callSid,
                       String playDtfm,
                       Legs dtmfLeg)
                throws TelapiException
DTMFs, aka touch tone signals, can be sent to a call.

Parameters:
callSid - The call to which to send DTMF signals.
playDtfm - Specifies which touch tone signals to send to a call. W or w can be used to include half second pauses within the digit transmission. For example: wwww1234 waits two seconds before sending the digits and 12wwww34 waits two seconds in between the sending of 12 and 34. Allowed values are digits, #, *, W or w.
dtmfLeg - Specifies which leg of the call digits will be sent to. 'aleg' leg is the originator of the call, 'bleg' is the recipient of the call. Defaults to aleg.
Returns:
The call to which DTMF signals are sent.
Throws:
TelapiException

playAudioToCall

public Call playAudioToCall(String accountSid,
                            String callSid,
                            String soundsUrl,
                            Long length,
                            Legs legs,
                            Boolean loop,
                            Boolean mix)
                     throws TelapiException
Throws:
TelapiException
See Also:
playAudioToCall(String, String, Long, Legs, Boolean, Boolean)

playAudioToCall

public Call playAudioToCall(String callSid,
                            String soundsUrl,
                            Long length,
                            Legs legs,
                            Boolean loop,
                            Boolean mix)
                     throws TelapiException
TelAPI allows you to play an audio file during a call. This is useful for playing hold music, providing IVR prompts, etc.

Parameters:
callSid - The call to which to play audio to.
soundsUrl - URL containg the sound file to play during the call. If multiple sounds are to be played, separate each by a comma in the request.
length - Time limit in seconds for audio play back.
legs - Specifies which leg of the call sound will play on. 'aleg' is the originator of the call, 'bleg' is the recipient of the call. Defaults to both.
loop - Specifies whether sound will loop. Set to true to play sound indefinitely. Defaults to false.
mix - Specifies whether sound should mix with call audio.
Returns:
The Call to which audio is played.
Throws:
TelapiException

playAudioToCall

public Call playAudioToCall(String callSid,
                            String soundsUrl)
                     throws TelapiException
TelAPI allows you to play an audio file during a call. This is useful for playing hold music, providing IVR prompts, etc. Plays the whole audio to both legs, without mixing and looping.

Parameters:
callSid - The call to which to play audio to.
soundsUrl - URL containg the sound file to play during the call. If multiple sounds are to be played, separate each by a comma in the request.
Returns:
The Call to which audio is played.
Throws:
TelapiException

voiceEffects

public Call voiceEffects(String accountSid,
                         String callSid,
                         AudioDirection audioDirection,
                         Double pitch,
                         Long pitchSemiTones,
                         Long pitchOctaves,
                         Double rate)
                  throws TelapiException
Throws:
TelapiException
See Also:
voiceEffects(String, AudioDirection, Double, Long, Long, Double)

voiceEffects

public Call voiceEffects(String callSid,
                         AudioDirection audioDirection,
                         Double pitch,
                         Long pitchSemiTones,
                         Long pitchOctaves,
                         Double rate)
                  throws TelapiException
With TelAPI you can modify the way a callers voice sounds by changing things such as speed and pitch of the audio.

Parameters:
callSid - The call to which to apply voice effects.
audioDirection - Specifies the stream of audio that effects will occur on. Set "in" to change incoming audio stream or "out" to change outgoing audio stream. Defaults to out.
pitch - Manually sets the pitch. The lower the value, the lower the tone. Must be a value greater than 0. Defaults to 1.
pitchSemiTones - Changes the pitch of audio in semitone intervals. Must be a value between -14 and 14. Defaults to 0.
pitchOctaves - Changes the pitch of audio in octave intervals. Must be a value between -1 and 1. Defaults to 0.
rate - Manually sets the rate starting from 1. The lower the value, the lower the rate. Defaults to 1.
Returns:
The Call to which voice effects are applied.
Throws:
TelapiException

recordCall

public RecordingList recordCall(String accountSid,
                                String callSid,
                                Boolean record,
                                Long timeLimit,
                                String callbackUrl)
                         throws TelapiException
Throws:
TelapiException
See Also:
recordCall(String, Boolean, Long, String)

recordCall

public RecordingList recordCall(String callSid,
                                Boolean record,
                                Long timeLimit,
                                String callbackUrl)
                         throws TelapiException
TelAPI offers a way to both initiate or end a call recording. Both processes are achieved using the same method. The parameters sent are what determines whether a recording will start or end if it is already in-progress.

Parameters:
callSid - The call which is to be recorded.
record - Specifies if call recording should beging or end. To start recording a call, value must be true. To stop recording a call, value must be false.
timeLimit - The time in seconds the duration a call recording should not exceed. If no value specified, recordings are 60 seconds by default.
callbackUrl - URL where recording information will be relayed to after it has completed.
Returns:
A list of recordings.
Throws:
TelapiException

viewConference

public Conference viewConference(String accountSid,
                                 String conferenceSid)
                          throws TelapiException
Throws:
TelapiException
See Also:
viewConference(String)

listConferences

public ConferenceList listConferences(String accountSid,
                                      String friendlyName,
                                      String status,
                                      Date dateCreatedGte,
                                      Date dateCreatedLt,
                                      Date dateUpdatedGte,
                                      Date dateUpdatedLt,
                                      Long page,
                                      Long pageSize)
                               throws TelapiException
Throws:
TelapiException
See Also:
#listConferences(String, Boolean, Boolean, Long, Long)

viewParticipant

public Participant viewParticipant(String accountSid,
                                   String conferenceSid,
                                   String callSid)
                            throws TelapiException
Throws:
TelapiException
See Also:
viewParticipant(String, String)

viewParticipant

public Participant viewParticipant(String conferenceSid,
                                   String callSid)
                            throws TelapiException
Participants of a conference are identified by the CallSid created when they dial into the conference. To access individual conference participants, use this method.

Parameters:
conferenceSid - The conference the participant is part of.
callSid - The call with which the participant participates in the conference.
Returns:
The selected participant.
Throws:
TelapiException

listParticipants

public List<Participant> listParticipants(String accountSid,
                                          String conferenceSid,
                                          Boolean muted,
                                          Boolean deaf,
                                          Long page,
                                          Long pageSize)
                                   throws TelapiException
Throws:
TelapiException
See Also:
listParticipants(String, Boolean, Boolean, Long, Long)

listParticipants

public List<Participant> listParticipants(String conferenceSid,
                                          Boolean muted,
                                          Boolean deaf,
                                          Long page,
                                          Long pageSize)
                                   throws TelapiException
Used to get a list of participants currently connected to a particular conference.

Parameters:
conferenceSid - The sid of the Conference for which participants are requested.
muted - Only list participants that are muted. Defaults to false.
deaf - Only list participants that are deaf. Defaults to false.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of participants currently connected to a particular conference.
Throws:
TelapiException

listParticipants

public List<Participant> listParticipants(String conferenceSid)
                                   throws TelapiException
Convenience method.

Throws:
TelapiException
See Also:
listParticipants(String, Boolean, Boolean, Long, Long)

deafOrMuteParticipant

public Participant deafOrMuteParticipant(String accountSid,
                                         String conferenceSid,
                                         String callSid,
                                         Boolean muted,
                                         Boolean deaf)
                                  throws TelapiException
Throws:
TelapiException
See Also:
deafOrMuteParticipant(String, String, Boolean, Boolean)

deafOrMuteParticipant

public Participant deafOrMuteParticipant(String conferenceSid,
                                         String callSid,
                                         Boolean muted,
                                         Boolean deaf)
                                  throws TelapiException
Conference participants can be muted or deafed by calling this method.

Parameters:
conferenceSid - The Conference the participant is a part of.
callSid - The Call used to identify the participant.
muted - Specifies whether the participant should be muted.
deaf - Specifies whether the participant should be deaf.
Returns:
The participant which was muted/unmuted/deafened/undeafened.
Throws:
TelapiException

hangupParticipant

public Participant hangupParticipant(String accountSid,
                                     String conferenceSid,
                                     String callSid)
                              throws TelapiException
Throws:
TelapiException
See Also:
#hangupMember(String, String)

hangupParticipant

public Participant hangupParticipant(String conferenceSid,
                                     String callSid)
                              throws TelapiException
Hangup conference members by conference sid and call sid.

Parameters:
conferenceSid - The sid of the requested Conference.
callSid - Specifies the member to hangup via the call used by the member to enter the conference.
Returns:
The Participant which was hung up on.
Throws:
TelapiException

playAudioToParticipant

public Participant playAudioToParticipant(String accountSid,
                                          String conferenceSid,
                                          String callSid,
                                          String url)
                                   throws TelapiException
Throws:
TelapiException
See Also:
playAudioToParticipant(String, String, String)

viewConference

public Conference viewConference(String conferenceSid)
                          throws TelapiException
Resource properties about conference calls that occurred through a TelAPI account can be requested using our API.

Parameters:
conferenceSid - The sid of the requested Conference.
Returns:
The requested conference.
Throws:
TelapiException

listConferences

public ConferenceList listConferences(String friendlyName,
                                      String status,
                                      Date dateCreatedGte,
                                      Date dateCreatedLt,
                                      Date dateUpdatedGte,
                                      Date dateUpdatedLt,
                                      Long page,
                                      Long pageSize)
                               throws TelapiException
To view a list of all conference resources associated with a given account, the URI below is provided. The response returned lists conferences in chronological order and includes information on each member of the conference.

Parameters:
friendlyName - List conferences with the given FriendlyName.
status - List conferences with the given status. Allowed values are: init, in-progress, or completed.
dateCreatedGte - List conferences created on or after this date.
dateCreatedLt - List conferences created before this date.
dateUpdatedGte - List conferences updated on or after this date.
dateUpdatedLt - List conferences updated before this date.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Conferences accorded to the specified parameters.s
Throws:
TelapiException

listConferences

public ConferenceList listConferences()
                               throws TelapiException
To view a list of all conference resources associated with a given account, the URI below is provided. The response returned lists conferences in chronological order and includes information on each member of the conference.

Returns:
A list of all the Conferences belonging to the account.
Throws:
TelapiException

playAudioToParticipant

public Participant playAudioToParticipant(String conferenceSid,
                                          String callSid,
                                          String audioUrl)
                                   throws TelapiException
Pre-recorded sound from a file can be played to conference members.

Parameters:
conferenceSid - The sid of the requested Conference.
callSid - Specifies the conference member to be spoken to via Call sid.
audioUrl - URL containing the audio file to play.
Returns:
The Participant to which the audio was played.
Throws:
TelapiException

viewApplication

public Application viewApplication(String accountSid,
                                   String applicationSid)
                            throws TelapiException
Throws:
TelapiException
See Also:
viewApplication(String)

listApplications

public ApplicationList listApplications(String accountSid,
                                        String friendlyName,
                                        Long page,
                                        Long pageSize)
                                 throws TelapiException
Throws:
TelapiException
See Also:
listApplications(String, Long, Long)

createApplication

public Application createApplication(String accountSid,
                                     String friendlyName,
                                     String voiceUrl,
                                     HttpMethod voiceMethod,
                                     String voiceFallbackUrl,
                                     HttpMethod voiceFallbackMethod,
                                     Boolean voiceCallerIdLookup,
                                     String smsUrl,
                                     HttpMethod smsMethod,
                                     String smsFallbackUrl,
                                     HttpMethod smsFallbackMethod,
                                     String heartbeatUrl,
                                     HttpMethod heartbeatMethod,
                                     String hangupCallback,
                                     HttpMethod hangupCallbackMethod)
                              throws TelapiException
Throws:
TelapiException
See Also:
createApplication(String, String, HttpMethod, String, HttpMethod, Boolean, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod)

createApplication

public Application createApplication(ApplicationRequest applicationRequest)
                              throws TelapiException
Throws:
TelapiException
See Also:
createApplication(String, String, HttpMethod, String, HttpMethod, Boolean, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod)

updateApplication

public Application updateApplication(String accountSid,
                                     String applicationSid,
                                     String friendlyName,
                                     String voiceUrl,
                                     HttpMethod voiceMethod,
                                     String voiceFallbackUrl,
                                     HttpMethod voiceFallbackMethod,
                                     Boolean voiceCallerIdLookup,
                                     String smsUrl,
                                     HttpMethod smsMethod,
                                     String smsFallbackUrl,
                                     HttpMethod smsFallbackMethod,
                                     String heartbeatUrl,
                                     HttpMethod heartbeatMethod,
                                     String hangupCallback,
                                     HttpMethod hangupCallbackMethod)
                              throws TelapiException
Throws:
TelapiException
See Also:
updateApplication(String, String, String, HttpMethod, String, HttpMethod, Boolean, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod)

updateApplication

public Application updateApplication(ApplicationRequest applicationRequest)
                              throws TelapiException
Throws:
TelapiException
See Also:
updateApplication(String, String, String, HttpMethod, String, HttpMethod, Boolean, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod)

deleteApplication

public Application deleteApplication(String accountSid,
                                     String applicationSid)
                              throws TelapiException
Throws:
TelapiException
See Also:
deleteApplication(String)

viewApplication

public Application viewApplication(String applicationSid)
                            throws TelapiException
TelAPI offers the ability to preset all voice and sms urls for a given application name. This application can then be assigned to multiple numbers so you don't have to update all of their urls manually. Application details can be accessed by using this method.

Parameters:
applicationSid - The sid of the requested Application.
Returns:
The requested application.
Throws:
TelapiException

listApplications

public ApplicationList listApplications(String friendlyName,
                                        Long page,
                                        Long pageSize)
                                 throws TelapiException
Used to get a list of application resources associated with a given account.

Parameters:
friendlyName - Specifies that only application resources matching the input FreindlyName should be returned in the list request.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of applications.
Throws:
TelapiException

listApplications

public ApplicationList listApplications()
                                 throws TelapiException
Used to get a list of all application resources associated with a given account.

Returns:
A list of all applications.
Throws:
TelapiException

createApplication

public Application createApplication(String friendlyName,
                                     String voiceUrl,
                                     HttpMethod voiceMethod,
                                     String voiceFallbackUrl,
                                     HttpMethod voiceFallbackMethod,
                                     Boolean voiceCallerIdLookup,
                                     String smsUrl,
                                     HttpMethod smsMethod,
                                     String smsFallbackUrl,
                                     HttpMethod smsFallbackMethod,
                                     String heartbeatUrl,
                                     HttpMethod heartbeatMethod,
                                     String hangupCallback,
                                     HttpMethod hangupCallbackMethod)
                              throws TelapiException
Creates a new application for managing TelAPI phone numbers,

Parameters:
friendlyName - The name used to identify this application.
voiceUrl - The URL returning InboundXML incoming calls should execute when connected.
voiceMethod - Specifies the HTTP method used to request the VoiceUrl once incoming call connects. Defaults to POST.
voiceFallbackUrl - URL used if any errors occur during execution of InboundXML on a call or at initial request of the VoiceUrl.
voiceFallbackMethod - Specifies the HTTP method (GET or POST) used to request the VoiceFallBackUrl if it is needed. Defaults to POST.
voiceCallerIdLookup - Look up the caller's caller ID name from the CNAM database (additional charges apply). Defaults to false.
smsUrl - The URL returning InboundXML incoming phone numbers should execute when receiving an sms.
smsMethod - The HTTP method used when making requests to the SmsUrl. Either GET or POST.
smsFallbackUrl - URL used if any errors occur during execution of InboundXML from an sms or at initial request of the SmsUrl.
smsFallbackMethod - Specifies the HTTP method (GET or POST) used to request the SmsFallbackUrl. Defaults to POST.
heartbeatUrl - URL that can be used to monitor the phone number.
heartbeatMethod - The HTTP method TelApi will use when requesting the HeartbeatURL. Either GET or POST. Defaults to POST.
hangupCallback - URL that can be requested to receive notification when and how incoming call has ended.
hangupCallbackMethod - Specifies the HTTP method (GET or POST) used to request the HangupCallback URL.
Returns:
The created Application.
Throws:
TelapiException

updateApplication

public Application updateApplication(String applicationSid,
                                     String friendlyName,
                                     String voiceUrl,
                                     HttpMethod voiceMethod,
                                     String voiceFallbackUrl,
                                     HttpMethod voiceFallbackMethod,
                                     Boolean voiceCallerIdLookup,
                                     String smsUrl,
                                     HttpMethod smsMethod,
                                     String smsFallbackUrl,
                                     HttpMethod smsFallbackMethod,
                                     String heartbeatUrl,
                                     HttpMethod heartbeatMethod,
                                     String hangupCallback,
                                     HttpMethod hangupCallbackMethod)
                              throws TelapiException
Used to update an existing application.

Parameters:
applicationSid - The sid of the application to update.
friendlyName - The name used to identify this application.
voiceUrl - The URL returning InboundXML incoming calls should execute when connected.
voiceMethod - Specifies the HTTP method used to request the VoiceUrl once incoming call connects. Defaults to POST.
voiceFallbackUrl - URL used if any errors occur during execution of InboundXML on a call or at initial request of the VoiceUrl.
voiceFallbackMethod - Specifies the HTTP method (GET or POST) used to request the VoiceFallBackUrl if it is needed. Defaults to POST.
voiceCallerIdLookup - Look up the caller's caller ID name from the CNAM database (additional charges apply). Defaults to false.
smsUrl - The URL returning InboundXML incoming phone numbers should execute when receiving an sms.
smsMethod - The HTTP method used when making requests to the SmsUrl. Either GET or POST.
smsFallbackUrl - URL used if any errors occur during execution of InboundXML from an sms or at initial request of the SmsUrl.
smsFallbackMethod - Specifies the HTTP method (GET or POST) used to request the SmsFallbackUrl. Defaults to POST.
heartbeatUrl - URL that can be used to monitor the phone number.
heartbeatMethod - The HTTP method TelApi will use when requesting the HeartbeatURL. Either GET or POST. Defaults to POST.
hangupCallback - URL that can be requested to receive notification when and how incoming call has ended.
hangupCallbackMethod - Specifies the HTTP method (GET or POST) used to request the HangupCallback URL.
Returns:
The edited Application.
Throws:
TelapiException

deleteApplication

public Application deleteApplication(String applicationSid)
                              throws TelapiException
Deletes an existing application.

Parameters:
applicationSid - The sid of the Application to delete.
Returns:
The deleted application.
Throws:
TelapiException

viewIncomingPhoneNumber

public IncomingPhoneNumber viewIncomingPhoneNumber(String accountSid,
                                                   String incomingPhoneNumberSid)
                                            throws TelapiException
Throws:
TelapiException
See Also:
viewIncomingPhoneNumber(String)

listIncomingPhoneNumbers

public IncomingPhoneNumberList listIncomingPhoneNumbers(String accountSid,
                                                        String phoneNumber,
                                                        String friendlyName,
                                                        Long page,
                                                        Long pageSize)
                                                 throws TelapiException
Throws:
TelapiException
See Also:
listIncomingPhoneNumbers(String, String, Long, Long)

addIncomingPhoneNumber

public IncomingPhoneNumber addIncomingPhoneNumber(String accountSid,
                                                  String phoneNumber,
                                                  String areaCode)
                                           throws TelapiException
Throws:
TelapiException
See Also:
addIncomingPhoneNumber(String, String)

deleteIncomingPhoneNumber

public IncomingPhoneNumber deleteIncomingPhoneNumber(String accountSid,
                                                     String incomingPhoneNumberSid)
                                              throws TelapiException
Throws:
TelapiException
See Also:
deleteIncomingPhoneNumber(String)

updateIncomingPhoneNumber

public IncomingPhoneNumber updateIncomingPhoneNumber(String accountSid,
                                                     String incomingPhoneNumberSid,
                                                     String friendlyName,
                                                     String voiceUrl,
                                                     HttpMethod voiceMethod,
                                                     String voiceFallbackUrl,
                                                     HttpMethod voiceFallbackMethod,
                                                     Boolean voiceCallerIdLookup,
                                                     String smsUrl,
                                                     HttpMethod smsMethod,
                                                     String smsFallbackUrl,
                                                     HttpMethod smsFallbackMethod,
                                                     String hangupCallback,
                                                     HttpMethod hangupCallbackMethod,
                                                     String heartbeatUrl,
                                                     HttpMethod heartbeatMethod)
                                              throws TelapiException
Throws:
TelapiException
See Also:
updateIncomingPhoneNumber(String, String, String, HttpMethod, String, HttpMethod, Boolean, String, HttpMethod, String, HttpMethod, String, HttpMethod, String, HttpMethod)

updateIncomingPhoneNumber

public IncomingPhoneNumber updateIncomingPhoneNumber(IncomingPhoneNumberRequest ipnRequest)
                                              throws TelapiException
Throws:
TelapiException
See Also:
#updateIncomingPhoneNumber(String, String, String, HttpMethod, String, HttpMethod, Boolean, String, HttpMethod, String, HttpMethod, String, HttpMethod)

viewIncomingPhoneNumber

public IncomingPhoneNumber viewIncomingPhoneNumber(String incomingPhoneNumberSid)
                                            throws TelapiException
TelAPI phone numbers associated with an account are represented with the IncomingPhoneNumber resource. This method gets information about an IncomingPhoneNumber.

Parameters:
incomingPhoneNumberSid - An alphanumeric string used for identification of incoming phone numbers.
Returns:
The requested IncomingPhoneNumber.
Throws:
TelapiException

listIncomingPhoneNumbers

public IncomingPhoneNumberList listIncomingPhoneNumbers(String phoneNumber,
                                                        String friendlyName,
                                                        Long page,
                                                        Long pageSize)
                                                 throws TelapiException
Retrieves a list of incoming phone number resources associated with a given account.

Parameters:
phoneNumber - Specifies which IncomingPhoneNumber resources should be returned in the list request.
friendlyName - Specifies that only IncomingPhoneNumber resources matching the input FreindlyName should be returned in the list request.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of IncomingPhoneNumber resources.
Throws:
TelapiException

listIncomingPhoneNumbers

public IncomingPhoneNumberList listIncomingPhoneNumbers()
                                                 throws TelapiException
Retrieves a list of all incoming phone number resources associated with a given account.

Returns:
A list of all IncomingPhoneNumber resources.
Throws:
TelapiException

addIncomingPhoneNumber

public IncomingPhoneNumber addIncomingPhoneNumber(String phoneNumber,
                                                  String areaCode)
                                           throws TelapiException
TelAPI incoming phone numbers can be added or removed from an account through our REST API. Note that adding numbers to an account via the REST API costs the same as purchasing them through your account dashboard on telapi.com.

Parameters:
phoneNumber - Desired phone number to add to the account (E.164 format). Must be a valid and available phone number (see #listAvailablePhoneNumbers(String, String, String, String, String) ).
areaCode - Desired area code of phone number to add to the account.
Returns:
The added IncomingPhoneNumber.s
Throws:
TelapiException

deleteIncomingPhoneNumber

public IncomingPhoneNumber deleteIncomingPhoneNumber(String incomingPhoneNumberSid)
                                              throws TelapiException
Deletes an IncomingPhoneNumber from your account. If the deletion is successful the incoming phone number resource of the item you have deleted will be returned. Please keep in mind that this resource item will be visible only once after deletion in the return so note anything about the resource you may need before it no longer exists.

Parameters:
incomingPhoneNumberSid - The sid of the IncomingPhoneNumber which is to be deleted.
Returns:
The deleted IncomingPhoneNumber
Throws:
TelapiException

updateIncomingPhoneNumber

public IncomingPhoneNumber updateIncomingPhoneNumber(String incomingPhoneNumberSid,
                                                     String friendlyName,
                                                     String voiceUrl,
                                                     HttpMethod voiceMethod,
                                                     String voiceFallbackUrl,
                                                     HttpMethod voiceFallbackMethod,
                                                     Boolean voiceCallerIdLookup,
                                                     String smsUrl,
                                                     HttpMethod smsMethod,
                                                     String smsFallbackUrl,
                                                     HttpMethod smsFallbackMethod,
                                                     String hangupCallback,
                                                     HttpMethod hangupCallbackMethod,
                                                     String heartbeatUrl,
                                                     HttpMethod heartbeatMethod)
                                              throws TelapiException
Updates properties of an IncomingPhoneNumber.

Parameters:
incomingPhoneNumberSid - The sid of the IncomingPhoneNumber which is to be updated.
friendlyName - The TelAPI phone number in an easier to read domestic format (e.g. 1234567890 to (123)-456-7890).
voiceUrl - The URL returning InboundXML incoming phone numbers should execute when connected.
voiceMethod - Specifies the HTTP method used to request the VoiceUrl once incoming call connects.
voiceFallbackUrl - URL used if any errors occur during execution of InboundXML during a call or at initial request of the VoiceUrl.
voiceFallbackMethod - Specifies the HTTP method used to request the VoiceFallBackUrl if it is needed.
voiceCallerIdLookup - Specifies whether CNAM caller ID look up is enabled with a particular incoming number.
hangupCallback - URL that can be requested to receive notification when and how incoming call has ended.
hangupCallbackMethod - Specifies the HTTP method used to request the HangupCallback URL.
heartbeatUrl - URL that can be requested every 60 seconds during the call to notify of elapsed time and pass other general information.
heartBeatMethod - Specifies the HTTP method used to request the Heartbeat URL.
smsUrl - The URL returning InboundXML incoming phone numbers should execute when receiving an sms.
smsMethod - Specifies the HTTP method used to request the SmsUrl.
smsFallbackUrl - URL used if any errors occur during execution of InboundXML from an sms or at initial request of the SmsUrl.
smsFallbackMethod - Specifies the HTTP method used to request the SmsFallbackUrl.
Returns:
The updated IncomingPhoneNumber.
Throws:
TelapiException

listAvailablePhoneNumbers

public AvailablePhoneNumberList listAvailablePhoneNumbers(String accountSid,
                                                          String isoCountryCode,
                                                          String areaCode,
                                                          String contains,
                                                          String inRegion,
                                                          String inPostalCode,
                                                          Long page,
                                                          Long pageSize)
                                                   throws TelapiException
Throws:
TelapiException
See Also:
#listAvailablePhoneNumbers(String, String, String, String, String)

listAvailablePhoneNumbers

public AvailablePhoneNumberList listAvailablePhoneNumbers(String isoCountryCode,
                                                          String areaCode,
                                                          String contains,
                                                          String inRegion,
                                                          String inPostalCode,
                                                          Long page,
                                                          Long pageSize)
                                                   throws TelapiException
If you want to add a new TelAPI number, you need to know what ones are available. Our REST API provides a way to request a list of available numbers along with all of their resource properties so you know the numbers you have to choose from.

Parameters:
isoCountryCode - ISO country code used for search (required).
areaCode - Specifies the area code that the returned list of available numbers should be in. Only available for North American numbers
contains - Specifies the desired characters contained within the available numbers to list. Allowed values are 0-9, Aa-Zz and *.
inRegion - Specifies the desired region of the available numbers to be listed.
inPostalCode - Specifies the desired postal code of the available numbers to be listed.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of available phone numbers.
Throws:
TelapiException

listRecordings

public RecordingList listRecordings(String accountSid,
                                    Date dateCreatedGte,
                                    Date dateCreatedLt,
                                    Long page,
                                    Long pageSize)
                             throws TelapiException
Throws:
TelapiException
See Also:
listRecordings(Date, Date, Long, Long)

listRecordings

public RecordingList listRecordings(Date dateCreatedGte,
                                    Date dateCreatedLt,
                                    Long page,
                                    Long pageSize)
                             throws TelapiException
Gets a list of Recordings.

Parameters:
dateCreatedGte - Recordings with a creation date greater or equal than this will be returned.
dateCreatedLt - Recordings with a creation date lesser than this will be returned.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Recordings.
Throws:
TelapiException

listRecordings

public RecordingList listRecordings()
                             throws TelapiException
Gets a list of all Recordings.

Returns:
A list of all Recordings.
Throws:
TelapiException

listCallRecordings

public RecordingList listCallRecordings(String accountSid,
                                        String callSid,
                                        Date dateCreatedGte,
                                        Date dateCreatedLt,
                                        Long page,
                                        Long pageSize)
                                 throws TelapiException
Throws:
TelapiException
See Also:
listCallRecordings(String, Date, Date, Long, Long)

listCallRecordings

public RecordingList listCallRecordings(String callSid,
                                        Date dateCreatedGte,
                                        Date dateCreatedLt,
                                        Long page,
                                        Long pageSize)
                                 throws TelapiException
Gets a list of Recordings which belong to a specified Call.

Parameters:
callSid - The sid of the Call for which the recordings are requested.
dateCreatedGte - Recordings with a creation date greater or equal than this will be returned.
dateCreatedLt - Recordings with a creation date lesser than this will be returned.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Recordings.
Throws:
TelapiException

viewRecording

public Recording viewRecording(String accountSid,
                               String recordingSid)
                        throws TelapiException
Throws:
TelapiException
See Also:
viewRecording(String)

viewRecording

public Recording viewRecording(String recordingSid)
                        throws TelapiException
A single recording details can be viewed by calling this method.

Parameters:
recordingSid - The sid of the requested Recording (required).
Returns:
The requested Recording.
Throws:
TelapiException

getRecordingUrl

public String getRecordingUrl(String accountSid,
                              String recordingSid)
                       throws TelapiException
Throws:
TelapiException
See Also:
getRecordingUrl(String)

getRecordingUrl

public String getRecordingUrl(String recordingSid)
                       throws TelapiException
Gets the URL of the audio file containing the recording.

Parameters:
recordingSid - The recording for which the audio file is requested.
Returns:
The URL to the audio file containing the selected Recording.
Throws:
TelapiException

listNotifications

public NotificationList listNotifications(String accountSid,
                                          LogLevel log,
                                          Long page,
                                          Long pageSize)
                                   throws TelapiException
Throws:
TelapiException
See Also:
listNotifications(LogLevel, Long, Long)

listNotifications

public NotificationList listNotifications(LogLevel log,
                                          Long page,
                                          Long pageSize)
                                   throws TelapiException
Returns a list of notifications associated with the account.

Parameters:
log - Specifies that only notifications with the given log level value should be listed. INFO, WARNING, or ERROR.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Notifications.
Throws:
TelapiException

listNotifications

public NotificationList listNotifications()
                                   throws TelapiException
Returns a list of all notifications associated with the account.

Returns:
A list of all Notifications.
Throws:
TelapiException

listCallNotifications

public NotificationList listCallNotifications(String accountSid,
                                              String callSid,
                                              LogLevel log,
                                              Long page,
                                              Long pageSize)
                                       throws TelapiException
Throws:
TelapiException
See Also:
listCallNotifications(String, LogLevel, Long, Long)

listCallNotifications

public NotificationList listCallNotifications(String callSid,
                                              LogLevel log,
                                              Long page,
                                              Long pageSize)
                                       throws TelapiException
Returns a list of notifications associated with a certain Call.

Parameters:
callSid - The sid of the Call for which Notifications are to be retrieved.
log - Specifies that only notifications with the given log level value should be listed. INFO, WARNING, or ERROR.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Notifications.
Throws:
TelapiException

viewNotification

public Notification viewNotification(String accountSid,
                                     String notificationSid)
                              throws TelapiException
Throws:
TelapiException
See Also:
viewNotification(String)

viewNotification

public Notification viewNotification(String notificationSid)
                              throws TelapiException
Retrieves details about a Notification.

Parameters:
notificationSid - The sid of the Notification to be retrieved.
Returns:
The requested Notification.
Throws:
TelapiException

viewTranscription

public Transcription viewTranscription(String accountSid,
                                       String transcriptionSid)
                                throws TelapiException
Throws:
TelapiException
See Also:
viewTranscription(String)

viewTranscriptionText

public String viewTranscriptionText(String accountSid,
                                    String transcriptionSid)
                             throws TelapiException
Throws:
TelapiException
See Also:
viewTranscriptionText(String)

listTranscriptions

public TranscriptionList listTranscriptions(String accountSid,
                                            TranscriptionStatus status,
                                            Date dateTranscribedGte,
                                            Date dateTranscribedLt,
                                            Long page,
                                            Long pageSize)
                                     throws TelapiException
Throws:
TelapiException
See Also:
listTranscriptions(TranscriptionStatus, Date, Date, Long, Long)

listRecordingTranscriptions

public TranscriptionList listRecordingTranscriptions(String accountSid,
                                                     String recordingSid,
                                                     TranscriptionStatus status,
                                                     Date dateTranscribedGte,
                                                     Date dateTranscribedLt,
                                                     Long page,
                                                     Long pageSize)
                                              throws TelapiException
Throws:
TelapiException
See Also:
listRecordingTranscriptions(String, TranscriptionStatus, Date, Date, Long, Long)

transcribeRecording

public Transcription transcribeRecording(String accountSid,
                                         String recordingSid,
                                         String transcribeCallback,
                                         HttpMethod callbackMethod,
                                         TranscriptionType quality)
                                  throws TelapiException
Throws:
TelapiException
See Also:
transcribeRecording(String, String, HttpMethod, TranscriptionType)

transcribeAudioUrl

public Transcription transcribeAudioUrl(String accountSid,
                                        String audioUrl,
                                        String transcribeCallback,
                                        HttpMethod callbackMethod,
                                        TranscriptionType quality)
                                 throws TelapiException
Throws:
TelapiException
See Also:
transcribeAudioUrl(String, String, HttpMethod, TranscriptionType)

viewTranscription

public Transcription viewTranscription(String transcriptionSid)
                                throws TelapiException
Gets the details of a Transcription resource.

Parameters:
transcriptionSid - The sid of the requested Transcription (required).
Returns:
The requested Transcription.
Throws:
TelapiException

viewTranscriptionText

public String viewTranscriptionText(String transcriptionSid)
                             throws TelapiException
Gets just the transcription text of a Transcription.

Parameters:
transcriptionSid - The sid of the requested Transcription (required).
Returns:
The transcription text of the requested Transcription.
Throws:
TelapiException

listTranscriptions

public TranscriptionList listTranscriptions(TranscriptionStatus status,
                                            Date dateTranscribedGte,
                                            Date dateTranscribedLt,
                                            Long page,
                                            Long pageSize)
                                     throws TelapiException
Lists transcriptions belonging to an account.

Parameters:
status - Used to only return transcriptions with a given status (completed, in-progress or failed).
dateTranscribedGte - Used to only return transcriptions that occurred at or after the given date.
dateTranscribedLt - Used to only return transcriptions that occurred at or before the given date.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Transcriptions.
Throws:
TelapiException

listTranscriptions

public TranscriptionList listTranscriptions()
                                     throws TelapiException
Lists all the transcriptions belonging to an account.

Returns:
A list of all Transcriptions.
Throws:
TelapiException

listRecordingTranscriptions

public TranscriptionList listRecordingTranscriptions(String recordingSid,
                                                     TranscriptionStatus status,
                                                     Date dateTranscribedGte,
                                                     Date dateTranscribedLt,
                                                     Long page,
                                                     Long pageSize)
                                              throws TelapiException
Lists all the transcriptions belonging to an account.

Parameters:
recordingSid - The sid of the Recording for which transcriptions are requested (required).
status - Used to only return transcriptions with a given status (completed, in-progress or failed).
dateTranscribedGte - Used to only return transcriptions that occurred at or after the given date.
dateTranscribedLt - Used to only return transcriptions that occurred at or before the given date.
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Transcriptions.
Throws:
TelapiException

transcribeRecording

public Transcription transcribeRecording(String recordingSid,
                                         String transcribeCallback,
                                         HttpMethod callbackMethod,
                                         TranscriptionType quality)
                                  throws TelapiException
Transcribes a recording.

Parameters:
recordingSid - The sid of the Recording to be transcribed (required).
transcribeCallback - URL that will be requested when the transcription has finished processing.
callbackMethod - Specifies the HTTP method to use when requesting the TranscribeCallback URL. Defaults to POST.
quality - Specifies the transcription quality. Transcription price differs for each quality tier. See the pricing page for details.
Returns:
The newly created Transcription.
Throws:
TelapiException

transcribeAudioUrl

public Transcription transcribeAudioUrl(String audioUrl,
                                        String transcribeCallback,
                                        HttpMethod callbackMethod,
                                        TranscriptionType quality)
                                 throws TelapiException
Transcribes audio found on an URL.

Parameters:
audioUrl - URL where the audio to be transcribed is located (required).
transcribeCallback - URL that will be requested when the transcription has finished processing.
callbackMethod - Specifies the HTTP method to use when requesting the TranscribeCallback URL. Defaults to POST.
quality - Specifies the transcription quality. Transcription price differs for each quality tier. See the pricing page for details.
Returns:
The newly created Transcription.
Throws:
TelapiException

carrierLookup

public CarrierLookupList carrierLookup(String accountSid,
                                       String phoneNumber)
                                throws TelapiException
Throws:
TelapiException
See Also:
carrierLookup(String)

carrierLookup

public CarrierLookupList carrierLookup(String accountSid,
                                       List<String> phoneNumber)
                                throws TelapiException
Throws:
TelapiException
See Also:
carrierLookup(List)

cnamLookup

public CnamDipList cnamLookup(String accountSid,
                              String phoneNumber)
                       throws TelapiException
Throws:
TelapiException
See Also:
cnamLookup(String)

cnamLookup

public CnamDipList cnamLookup(String accountSid,
                              List<String> phoneNumbers)
                       throws TelapiException
Throws:
TelapiException
See Also:
cnamLookup(List)

carrierLookup

public CarrierLookupList carrierLookup(String phoneNumber)
                                throws TelapiException
Provides a way to look up the carrier of a phone number.

Parameters:
phoneNumber - The number of the phone you are attempting to perform the carrier look up on. Multiple PhoneNumbers to lookup can be specified in a single request by seperating them with commas.
Returns:
The CarrierLookup information for the requested number.
Throws:
TelapiException

carrierLookup

public CarrierLookupList carrierLookup(List<String> phoneNumber)
                                throws TelapiException
Provides a way to look up the carrier of phone numbers.

Parameters:
phoneNumber - The phone numbers you are attempting to perform the carrier look up on.
Returns:
The CarrierLookup information for the requested numbers.
Throws:
TelapiException

cnamLookup

public CnamDipList cnamLookup(String phoneNumber)
                       throws TelapiException
Performs a CNAM lookup for a phone number.

Parameters:
phoneNumber - The number of the phone you are attempting to perform the CNAM look up on. Multiple PhoneNumbers to lookup can be specified in a single request by seperating them with commas.
Returns:
CNAM lookup information.
Throws:
TelapiException

cnamLookup

public CnamDipList cnamLookup(List<String> phoneNumbers)
                       throws TelapiException
Performs a CNAM lookup for multiple phone numbers.

Parameters:
phoneNumbers - The phone numbers you are attempting to perform the CNAM look up on.
Returns:
CNAM lookup information.
Throws:
TelapiException

listFraudControlResources

public FraudList listFraudControlResources(String accountSid,
                                           Long page,
                                           Long pageSize)
                                    throws TelapiException
Throws:
TelapiException
See Also:
listFraudControlResources(Long, Long)

authorizeDestination

public FraudList authorizeDestination(String accountSid,
                                      String countryCode,
                                      Boolean mobileEnabled,
                                      Boolean landlineEnabled,
                                      Boolean smsEnabled)
                               throws TelapiException
Throws:
TelapiException
See Also:
authorizeDestination(String, Boolean, Boolean, Boolean)

blockDestination

public FraudList blockDestination(String accountSid,
                                  String countryCode,
                                  Boolean mobileEnabled,
                                  Boolean landlineEnabled,
                                  Boolean smsEnabled)
                           throws TelapiException
Throws:
TelapiException
See Also:
blockDestination(String, Boolean, Boolean, Boolean)

extendDestinationAuth

public FraudList extendDestinationAuth(String accountSid,
                                       String countryCode,
                                       Boolean mobileEnabled,
                                       Boolean landlineEnabled,
                                       Boolean smsEnabled)
                                throws TelapiException
Throws:
TelapiException
See Also:
extendDestinationAuth(String, Boolean, Boolean, Boolean)

whitelistDestination

public FraudList whitelistDestination(String accountSid,
                                      String countryCode,
                                      Boolean mobileEnabled,
                                      Boolean landlineEnabled,
                                      Boolean smsEnabled)
                               throws TelapiException
Throws:
TelapiException
See Also:
whitelistDestination(String, Boolean, Boolean, Boolean)

listFraudControlResources

public FraudList listFraudControlResources(Long page,
                                           Long pageSize)
                                    throws TelapiException
Gets a list of Fraud control resources for a certain account.

Parameters:
page - Used to return a particular page within the list.
pageSize - Used to specify the amount of list items to return per page.
Returns:
A list of Fraud control resources.
Throws:
TelapiException

listFraudControlResources

public FraudList listFraudControlResources()
                                    throws TelapiException
Gets a list of Fraud control resources for a certain account.

Returns:
A list of Fraud control resources.
Throws:
TelapiException

authorizeDestination

public FraudList authorizeDestination(String countryCode,
                                      Boolean mobileEnabled,
                                      Boolean landlineEnabled,
                                      Boolean smsEnabled)
                               throws TelapiException
Used to authorize previously blocked destinations for outbound calls and sms messages. Authorize is only meant to provide temporary permission: see the whitelist docs if you want to permanently enable a destinations. Unless extended, authorized destination will expire after 30 days. For examples of valid country codes to use in the request URL see this article.

Parameters:
countryCode - The country code which you want to authorize.
mobileEnabled - Mobile status for the destination. If false, all mobile call activity will be rejected or disabled. Defaults to true.
landlineEnabled - Landline status for the destination. If false, all landline call activity will be rejected or disabled. Defaults to true.
smsEnabled - SMS status for the destination. If false, all SMS activity will be rejected or disabled. Defaults to true.
Returns:
A list of Fraud control resources.
Throws:
TelapiException

blockDestination

public FraudList blockDestination(String countryCode,
                                  Boolean mobileEnabled,
                                  Boolean landlineEnabled,
                                  Boolean smsEnabled)
                           throws TelapiException
TelAPI will restrict outbound calls and sms messages to blocked destinations. For examples of valid country codes to use in the request URL see this article.

Parameters:
countryCode - The country code which you want to authorize.
mobileEnabled - Mobile status for the destination. If false, all mobile call activity will be rejected or disabled. Defaults to true.
landlineEnabled - Landline status for the destination. If false, all landline call activity will be rejected or disabled. Defaults to true.
smsEnabled - SMS status for the destination. If false, all SMS activity will be rejected or disabled. Defaults to true.
Returns:
A list of Fraud control resources.
Throws:
TelapiException

extendDestinationAuth

public FraudList extendDestinationAuth(String countryCode,
                                       Boolean mobileEnabled,
                                       Boolean landlineEnabled,
                                       Boolean smsEnabled)
                                throws TelapiException
By default, authorized destinations will expire and return to fully blocked status after 30 days. The extend method is provided to extend a destinations authorization expiration by 30 days. The extention is not additive, it will put the expiration date 30 days from the date the extension was made. For examples of valid country codes to use in the request URL see this article.

Parameters:
countryCode - The country code which you want to authorize.
mobileEnabled - Mobile status for the destination. If false, all mobile call activity will be rejected or disabled. Defaults to true.
landlineEnabled - Landline status for the destination. If false, all landline call activity will be rejected or disabled. Defaults to true.
smsEnabled - SMS status for the destination. If false, all SMS activity will be rejected or disabled. Defaults to true.
Returns:
A list of Fraud control resources.
Throws:
TelapiException

whitelistDestination

public FraudList whitelistDestination(String countryCode,
                                      Boolean mobileEnabled,
                                      Boolean landlineEnabled,
                                      Boolean smsEnabled)
                               throws TelapiException
Whitelisting is provided for destinations you wish to permanently authorize.

Parameters:
countryCode - The country code which you want to authorize.
mobileEnabled - Mobile status for the destination. If false, all mobile call activity will be rejected or disabled. Defaults to true.
landlineEnabled - Landline status for the destination. If false, all landline call activity will be rejected or disabled. Defaults to true.
smsEnabled - SMS status for the destination. If false, all SMS activity will be rejected or disabled. Defaults to true.
Returns:
A list of Fraud control resources.
Throws:
TelapiException


Copyright © 2012. All Rights Reserved.