ColdFusion Fax - Get List of Inbound Faxes

The GetList method demonstrated in this sample allows you to retrieve a list of inbound (received) faxes with ColdFusion.

In the ColdFusion fax snippet below, the GetList method is used to display information for a number of submitted faxes:


<!--- Username and password for the Interfax account. --->
<cfset interfaxUsername = "">
<cfset interfaxPassword = "">

<cfset objMessageItem = ArrayNew(1)>
<cfset listType       = "AllMessages">
<cfset maxItems    = 10>

<!--- Create and call the web service --->
<cfset faxWebservice = CreateObject("webservice", "")>

<cfset resultCode = faxWebservice.getList(interfaxUsername, interfaxPassword, listType, maxItems, "objMessageItem")>

<!--- If the result code is 0 then the call was succesfull --->
<cfif resultCode eq 0>

    <!--- If the objMessageItems doen't exist then we don't have any faxes on the server --->
    <cfif isDefined("objMessageItem")>

        <!--- Get all the faxes --->
        <cfset faxItems = objMessageItem.getMessageItem()>

        <!--- Display the info for the retrieved faxes --->
        <table border="2">
        <cfloop from="1" to="#ArrayLen( faxItems )#" index="i">
            <cfset currentFaxItem = faxItems[i]>


        No faxes to retrieve.



    Error message: #resultCode#


Contact us today

Talk to a member of our team about the benefits InterFAX can bring to your organization's communications processes.

Contact us today