com.hoiio.sdk.services
Class NumberService

java.lang.Object
  extended by com.hoiio.sdk.services.HttpService
      extended by com.hoiio.sdk.services.NumberService

public class NumberService
extends HttpService

The Number API will allow developers to have full control over how they assign their Hoiio Numbers to their IVR applications.

For more info please refer to: http://developer.hoiio.com/docs/number.html


Constructor Summary
NumberService(String appId, String accessToken)
          Constructs the service to make all Number requests
 
Method Summary
 ActiveNumber fetchActiveNumbers()
          Retrieves the list of Hoiio Numbers that is assigned to your application and their current configuration.
 AvailableNumber fetchAvailableNumbers(String country)
          Returns a list of available Hoiio Numbers for subscription in a given country
 AvailableNumber fetchAvailableNumbers(String country, String state)
          Returns a list of available Hoiio Numbers for subscription in a given country
 AvailableNumber fetchAvailableNumbers(String country, String state, Integer page)
          Returns a list of available Hoiio Numbers for subscription in a given country
 NumberRate fetchRate(String country)
          Retrieves the billable rate that will be charged for subscribing to a Hoiio Number
 SupportedCountry fetchSupportedCountry()
          Retrieves a list of countries for which there are Hoiio Numbers available for subscription.
 Subscribe subscribe(String number, NumberDuration duration)
          Subscribes for a new Hoiio Number or extend an existing subscription of a Hoiio Number
 UpdateForwarding updateForwarding(String number)
          Configures the URL that the incoming call notification and incoming SMS notification for your Hoiio Number will be sent to
 UpdateForwarding updateForwarding(String number, String forwardTo, String forwardToSms, VoiceMode mode)
          Configures the URL that the incoming call notification and incoming SMS notification for your Hoiio Number will be sent to
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberService

public NumberService(String appId,
                     String accessToken)
Constructs the service to make all Number requests

Parameters:
appId - AppID of the developer
accessToken - AccessToken of the developer
Method Detail

fetchActiveNumbers

public ActiveNumber fetchActiveNumbers()
                                throws HoiioException
Retrieves the list of Hoiio Numbers that is assigned to your application and their current configuration.

Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchAvailableNumbers

public AvailableNumber fetchAvailableNumbers(String country)
                                      throws HoiioException
Returns a list of available Hoiio Numbers for subscription in a given country

Parameters:
country - Select the country that you wish to browse the list of available Hoiio Numbers. Use country code in ISO 3166-1 alpha-2 format.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchAvailableNumbers

public AvailableNumber fetchAvailableNumbers(String country,
                                             String state)
                                      throws HoiioException
Returns a list of available Hoiio Numbers for subscription in a given country

Parameters:
country - Select the country that you wish to browse the list of available Hoiio Numbers. Use country code in ISO 3166-1 alpha-2 format.
state - (required for USA) Select the state within the country to browse the list of available Hoiio Numbers. Use the two letter state code defined in ISO 3166-2.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchAvailableNumbers

public AvailableNumber fetchAvailableNumbers(String country,
                                             String state,
                                             Integer page)
                                      throws HoiioException
Returns a list of available Hoiio Numbers for subscription in a given country

Parameters:
country - Select the country that you wish to browse the list of available Hoiio Numbers. Use country code in ISO 3166-1 alpha-2 format.
state - (required for USA) Select the state within the country to browse the list of available Hoiio Numbers. Use the two letter state code defined in ISO 3166-2.
page - (optional) Each request returns a maximum of 20 entries. This parameter indicates which subset of entries to return.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchRate

public NumberRate fetchRate(String country)
                     throws HoiioException
Retrieves the billable rate that will be charged for subscribing to a Hoiio Number

Parameters:
country - Select the country that you wish to check the rates. Use country code in ISO 3166-1 alpha-2 format.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchSupportedCountry

public SupportedCountry fetchSupportedCountry()
                                       throws HoiioException
Retrieves a list of countries for which there are Hoiio Numbers available for subscription.

Returns:
Object containing all the responses from the server
Throws:
HoiioException

subscribe

public Subscribe subscribe(String number,
                           NumberDuration duration)
                    throws HoiioException
Subscribes for a new Hoiio Number or extend an existing subscription of a Hoiio Number

Parameters:
number - The Hoiio Number that you want to subscribe or extend subscription. Numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
duration - The number of months that you wished to subscribe or extend subscription for the specified Hoiio Number: 1,3,12, auto_extend
Returns:
Object containing all the responses from the server
Throws:
HoiioException

updateForwarding

public UpdateForwarding updateForwarding(String number)
                                  throws HoiioException
Configures the URL that the incoming call notification and incoming SMS notification for your Hoiio Number will be sent to

Parameters:
number - The Hoiio Number to configure. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

updateForwarding

public UpdateForwarding updateForwarding(String number,
                                         String forwardTo,
                                         String forwardToSms,
                                         VoiceMode mode)
                                  throws HoiioException
Configures the URL that the incoming call notification and incoming SMS notification for your Hoiio Number will be sent to

Parameters:
number - The Hoiio Number to configure. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
forwardTo - (optional) A fully-qualified HTTP/S URL on your web server to be notified when there is an incoming voice call/fax
forwardToSms - (optional) A fully-qualified HTTP/S URL on your web server to be notified when there is an incoming SMS
mode - (optional) Indicate whether to use the number for incoming voice call or fax
Returns:
Object containing all the responses from the server
Throws:
HoiioException