PHPFaxTo is a PHP class for easy use of the fax.to Fax API.
$fax = new FaxTo('<your api code here>');
echo $fax->getCashBalance(); // e.g. 3.7
echo $fax->getFaxCost(<fax number>, <id of the document you want to send>); // e.g. 0.1
$status = $fax->getFaxStatus(<job id>); // associative array
$history = $fax->getFaxHistory(); // associative array
Either document_id OR file must be set, not both.
$sent = sendFax($fax_number, $document_id = null, $tsi_number = null, $file = null, $delete_file = null); // associative array
$files = $fax->getFiles(); // associative array
set is_remote to true if you need to supply a remote file path, e.g. http://domain.com/file.ext
$file = $fax->uploadFile(<file path>, $is_remote = false); // associative array
$deleted = $fax->deleteFile(<file id>); // associative array
When sending a fax (and if it didn't fail immediately), status = executed and a fax_job_id will be returned. The fax_job_id will also be supplied in the callback in order to identify a fax sending process.