com.hoiio.sdk.services
Class FaxService

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

public class FaxService
extends HttpService

Fax API provides developers access to faxing capabilities by using our simple API. Developers can use the Fax API to send, and also to receive fax via Hoiio virtual numbers.

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


Constructor Summary
FaxService(String appId, String accessToken)
          Constructs the service to make all Fax requests
 
Method Summary
 Fax fetchFax(String txnRef)
          Querys the current status of a fax made previously
 FaxHistory fetchHistory()
          Retrieves the history of faxes sent by this application.
 FaxHistory fetchHistory(Date from, Date to, Integer page, FaxType type)
          Retrieves the history of faxes sent by this application.
 FaxRate fetchIncomingRate(String incoming)
          Retrieves the billable rate that will be charged for fax received
 FaxRate fetchOutgoingRate(String dest)
          Retrieves the billable rate that will be charged for fax sent
 FaxTxn send(String dest, File file)
          Sends a fax file to a fax number.
 FaxTxn send(String dest, File file, String filename, String callerId, String tag, String notifyUrl)
          Sends a fax file to a fax number.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaxService

public FaxService(String appId,
                  String accessToken)
Constructs the service to make all Fax requests

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

fetchFax

public Fax fetchFax(String txnRef)
             throws HoiioException
Querys the current status of a fax made previously

Parameters:
txnRef - The unique reference ID for the required transaction.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchHistory

public FaxHistory fetchHistory()
                        throws HoiioException
Retrieves the history of faxes sent by this application.

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

fetchHistory

public FaxHistory fetchHistory(Date from,
                               Date to,
                               Integer page,
                               FaxType type)
                        throws HoiioException
Retrieves the history of faxes sent by this application.

Parameters:
from - (optional) Retrieve fax history made by this app starting from this date/time in "YYYY-MM-DD HH:MM:SS" (GMT+8) format. E.g. "2010-01-01 00:00:00". If omitted, fax history will be retrieved from the earliest transaction.
to - (optional) Retrieve fax history made by this app before this date/time in "YYYY-MM-DD HH:MM:SS" (GMT+8) format. E.g. "2010-01-01 00:00:00". If omitted, fax history will be retrieved up to the current point of time.
page - (optional) Each request returns a maximum of 100 entries. This parameter indicates which subset of entries to return.
type - (optional) The type of transaction you want to retrieve: outgoing, incoming, all
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchIncomingRate

public FaxRate fetchIncomingRate(String incoming)
                          throws HoiioException
Retrieves the billable rate that will be charged for fax received

Parameters:
incoming - Your Hoiio number to receive incoming fax.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchOutgoingRate

public FaxRate fetchOutgoingRate(String dest)
                          throws HoiioException
Retrieves the billable rate that will be charged for fax sent

Parameters:
dest - The recipient number of the fax. 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

send

public FaxTxn send(String dest,
                   File file)
            throws HoiioException
Sends a fax file to a fax number.

Parameters:
dest - The destination to send the fax to. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
file - The file to be faxed. The file must be in PDF format with a page size of either A4 or Letter and its file size can be at most 2MB.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

send

public FaxTxn send(String dest,
                   File file,
                   String filename,
                   String callerId,
                   String tag,
                   String notifyUrl)
            throws HoiioException
Sends a fax file to a fax number.

Parameters:
dest - The destination to send the fax to. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
file - The file to be faxed. The file must be in PDF format with a page size of either A4 or Letter and its file size can be at most 2MB.
filename - (optional) The name of the file that is downloaded from the fax_url given in FetchFax and FetchHistory.
callerId - (optional) This is the Caller ID that the receiver will see on their incoming fax
tag - (optional) This is a text string containing your own reference ID for this transaction. This value will be included in the response for Notification, FetchFax and FetchHistory for your reference. Max 256 characters.
notifyUrl - (optional) A fully-qualified HTTP/S callback URL on your web server to be notified when the fax finishes
Returns:
Object containing all the responses from the server
Throws:
HoiioException