Navigation:  Customizing CopiaFacts >

The Send Fax API

Previous pageReturn to chapter overviewNext page

The CopiaFacts API for sending faxes, e-mails and voice messages is a simple file-based API. Any program which can write an ASCII file into one of the TOSEND directories can initiate a fax transmission. CopiaFacts will monitor the transmission, control retries, and report the results. If your program needs to determine the outcome of the transmission it can either read the DBF daily log file, scanning for the FS file number, or monitor the SENT and FAIL subdirectories, to one of which the FS file will be moved on completion.

The file name of the ASCII file should have extension .FS and the file contains commands listed under FS File Commands. As a minimum for fax operations, you must specify $fax_phone and $fax_user. Also, you must either specify a cover sheet with $fax_cover or one or more documents to be transmitted, using $fax_filename, or both.

The filename part of the FS file must be numeric and unique. You can either use your own range of FS file numbers different from that used by CopiaFacts, or you can use the NEXTFS file in the TOSEND subdirectory to control FS file numbers. If you use the NEXTFS file, you should lock it briefly while you read and increment the number it contains, and arrange to retry this operation if CopiaFacts or another utility already has the file locked when you attempt to read and update it. If the incrementing number would cause it to exceed 8 digits, you must reset it to 1.

To ensure the maximum reliability of your application, we suggest first writing the FS file with a different name, or in a different directory, and renaming it when you have completely written it. There may be a brief time window in which the file is readable by CopiaFacts after it has been created but before it has been completely written. However there are many users who ignore this precaution without encountering problems.

You can use the TOSEND1 through TOSEND9 directories, when defined on the $request_dir configuration command, to control the priority of the transmission or the blackout times. You should not normally place FS files directly in the special preprocessing directories for document conversion; CopiaFacts will move such files from the TOSEND directories when needed.

Examples

A minimum FS file to send a fax:

$fax_filename "@FFBASE\image\00001154.TIF"

$fax_phone 3105553218

$fax_user @FFBASE\fax.usr

A minimum FS file to send an e-mail:

$email_address steve@copia.com

$email_esender tim@copia.com

$email_subject "Sample_message"

$fax_user @FFBASE\email.usr

Fax FS file with additional commands:

$fax_filename "@FFBASE\image\00001154.TIF"

$fax_cover @FFBASE\copia.cvr

$fax_header "Please deliver to @ROUTETO"

$fax_sender "Dorothy Gaden"

$fax_receiver "Ann Other"

$fax_send_time 17:00:00

$fax_phone 3105553218

$fax_status1 2

$fax_user @FFBASE\fax.usr

$var_def ToCompany "Other Company Inc."

 


Topic url: http://www.copia.com/support/refmanual/index.html?thesendfaxapi.htm