InterFax Integration: Submission as PDF to Fax Machine

  • Profile Image
    ErikasCucina
    Asked on September 10, 2013 at 11:44 AM

    I'm trying to host PHP code from Interfax that will take the PDF of a form submiited and send it to a fax machine. Will you be able to explain to me how I will insert the code here to do this?

     

    HERE's THE PHP CODE:

    <?php

     

    /**************** Settings begin **************/ 

    $username          = '';  // Insert your InterFAX username here
    $password          = '';  // Insert your InterFAX password here
    $faxnumber         = '';  // Enter the destination fax number here, e.g. +497116589658
    $filename          = 'test.pdf'; // A file in your filesystem
    $filetype          = 'PDF'; // File format; supported types are listed at 
                       // http://www.interfax.net/en/help/supported_file_types 

     /**************** Settings end ****************/

     // Open File
    if( !($fp = fopen($filename, "r"))){

        // Error opening file

        echo "Error opening file";

        exit;

    }

     

    // Read data from the file into $data

    $data = "";

    while (!feof($fp)) $data .= fread($fp,1024);

    fclose($fp);

     

     

    $client = new SoapClient("http://ws.interfax.net/dfs.asmx?WSDL");

     

    $params->Username  = $username;

    $params->Password  = $password;

    $params->FaxNumber = $faxnumber;

    $params->FileData  = $data;

    $params->FileType  = $filetype;

     

    $result = $client->Sendfax($params);

    echo $result->SendfaxResult; // returns the transactionID if successful

                                 // or a negative number if otherwise

     

     

    ?>

  • Profile Image
    Welvin
    Answered on September 10, 2013 at 01:19 PM

    Hi,

    I've check InterFax and so to clarify, you would like that each of your form submission will be "SEND" over to a Fax Machine?

    I guess  you have the codes from: http://www.interfax.net/en/dev/webservice/samples/php/sendfax which is part of InterFax API. I think we need the help of our API team about so I'd like you to direct this inquiry to them. You can contact them through this form: http://api.jotform.com/docs/#contact.

    Let me also add this to our feature request list. However, there is no definite timeframe as to when this get implemented or if there is any assurance that our developers will add this as part of our integration.

    Thanks