Scheduling a Fax

An application can schedule a fax by posting the schedule fax XML to the ofax resource. If the fax is scheduled successfully, a response is returned with the scheduled entries.

Notes:

  • Place each file that you want to attach as fax pages in an attachment element.
  • Inline attachments are attachments with the file contents inserted in the content tag.
  • Use base64 to encode inline attachments.
  • Unless the file basename is not unique among the attachments, the attachment name can usually be set to the file basename.
  • The name is used primarily for error responses, so if you want to know which attachment failed, make this field unique.
  • Set the attachment content type to match the type of the file being transferred. For Example, if attaching a PDF, set the content type to “application/pdf”. FaxFinder uses content type to convert the file into fax pages. It does not attempt to guess the content type.

    Limits

    Request size: 36MB

    Maximum Recipients per Fax: 400

    Query Parameters

    None

    HTTP Request Line

    POST /ffws/v1/ofax HTTP/1.1

    HTTP Response Status Codes

    201 Created

    The fax has been created successfully.

    400 Bad Request

    Invalid request. The fax has not been scheduled. The response message may provide more details.

    Set the attachment content type to match the type of the file being transferred. For Example, if attaching a PDF, set the content type to “application/pdf”. FaxFinder uses content type to convert the file into fax pages. It does not attempt to guess the content type.

    Example

    POST /ffws/v1/ofax HTTP/1.1  
    content-type: application/xml  
    authorization: Basic YWRtaW46YWRtaW4=  
    <?xml version=”1.0” encoding=”UTF-8”?>
    <schedule_fax> 
    	<cover_page>
    	<url>https://192.168.2.1/ffws/v1/data/cover_pages/default.pdf</url>
    		<enabled>true</enabled> 
    		<subject>Test Subject</subject> 
    		<comments>Test Message</comments> 
    	</cover_page> 
    	<sender>  
    		<name>Sender Name</name>
    		<organization>Sender Org</organization>
    		<phone_number>218-555-3333</phone_number>
    		<fax_number>218-555-3334</fax_number>
    		<email_address>sender@Example.com</email_address>
    	</sender> 	
    	<recipient> 
    		<name>Rcpt 1 Name</name> 
    		<organization>Rcpt 1 Org</organization>
    		<fax_number>-218-555-3335</fax_number>
    		<phone_number>218-555-3336</phone_number> 
    	</recipient> 
    	<attachment> 
    		<location>inline</location>  
    		<name>attachment1.txt</name>  
    		<content_type>text/plain</content_type>
    		<content_transfer_encoding>base64</content_transfer_encoding>
    		<content>dGVzdA==</content>  
    	</attachment>  
    	<max_tries>3</max_tries>  
    	<priority>3</priority>  
    	<try_interval>30</try_interval>  
    	<receipt>failure</receipt>  
    	<receipt_attachment>none</receipt_attachment> 
    	<schedule_all_at>2008-08-07T20:30:00</schedule_all_at> 
    </schedule_fax>  
    -----------------------------------  
    HTTP/1.1 201 Created  
    content-type: application/xml 
     
    <?xml version=”1.0” encoding=”UTF-8”?> 
    <response>  
    	 <message>Success</message>  
    	<fax_entry>
    	<fax_entry_url>https://192.168.2.1/ffws/v1/ofax/0000001B/0000</fax_entry_url> 
    	 <fax_url>https://192.168.2.1/ffws/v1/ofax/0000001B</fax_url>  
    		 <state>preprocessing</state>  
    		 <schedule_message>New fax entry</schedule_message>  
    		 <created>2008-08-01 08:43:29</created>  
    		 <stime>2008-08-01 08:52:29</stime>  
    		 <try_number>1</try_number>  
    		 <agent>FFWS</agent>  
    		 <preview>https://192.168.2.1/ffws/v1/data/preview/0000001B-0000.pdf</preview>  
    		 <cover_page>  
    			 <url>https://192.168.2.1/ffws/v1/data/cover_pages/default.pdf</url>  
    			 <enabled>true</enabled>  
    			<subject>Test Subject</subject>  
    			 <comments>Test Message</comments>  
    		 </cover_page>  
    			 <sender>  
    			 <username>admin</username>  
    			 <name>Sender Name</name>  
    			 <organization>Sender Org</organization>  
    			 <phone_number>218-555-3333</phone_number>  
    			 <fax_number>218-555-3334</fax_number>  
    			 <email_address>sender@Example.com</email_address>  
    		 </sender>  
    		 <recipient>  
    			 <name>Rcpt 1 Name</name>  
    			 <organization>Rcpt 1 Org</organization>  
    			 <fax_number>218-555-3335</fax_number>  
    			 <phone_number>218-555-3336</phone_number>  
    		 </recipient>   
    		 <max_tries>3</max_tries>  
    		 <priority>3</priority>  
    		 <try_interval>30</try_interval>  
    		 <receipt>failure</receipt>  
    		 <receipt_attachment>none</receipt_attachment>  
    		 <pages>0</pages>  
    		 <approver></approver>  
    		 <approval_time></approval_time>  
    	</fax_entry>  
     </response>