Barcoding

We support barcoding on both sent and received faxes.   We can write barcodes in Data Matrix, but we can read Data Matrix as well as PDF417.

Please note, in general, barcodes should be kept smaller than 400 pixels (2 inches height and width) for DataMatrix, or 800 pixels (4 inches height and width) for PDF417.  In most cases, a barcode of 100 pixels (1/2 inch height and width) is sufficient (for DataMatrix, which is our standard format) in size to contain all of the data you will be passing and still be read.

If you want us to read bar codes on faxes that are coming into your Sfax account, you need to make sure your account is enabled for Inbound Barcode reading.  To confirm that you can contact support.  

Use &OptionalParams &BarcodeOption - Parameter is used only to pass information to create a barcode on fax pages outgoing. 

BarcodeData= is a string value used to create the barcode data, additional barcodes can be passed using the same parameter BarcodeData in a separate BarcodeOption set. 
BarcodeX= 
BarcodeY= These are both integer values to determine the x and y coordinate position on a page to place the barcode(s). A 8.5 X 11 page is 1700 X 2200 pixels. *We recommend placing the barcode 50 pixels or more from the edge of the page.
BarcodePage= is an integer value used to determine what page(s) to place the barcode(s) on. 
BarcodeScale= is preset to size 3 but can be passed as an additional parameter to change the sizing of the barcode. The sizes available are 3,4,5,6,7,8,9,20,30 and 40. 

Code Sample:

Example Barcode Parameters for API, in this example we pass 2 barcodes on the same page. 

"&BarcodeOption=" + "BarcodeData=", HttpUtility.UrlEncode(barcode1) + ";" + "BarcodeX=", HttpUtility.UrlEncode(barcode1x) + ";" + "BarcodeY=", HttpUtility.UrlEncode(barcode1y) + ";" + "BarcodePage=", HttpUtility.UrlEncode(barcodepage) + ";" + "BarcodeScale=", HttpUtility.UrlEncode(barcodescale),                "&BarcodeOption=" + "BarcodeData=", HttpUtility.UrlEncode(barcode2) + ";" + "BarcodeX=", HttpUtility.UrlEncode(barcode2x) + ";" + "BarcodeY=", HttpUtility.UrlEncode(barcode2y) + ";" + "BarcodePage=", HttpUtility.UrlEncode(barcodepage) + ";" + "BarcodeScale=", HttpUtility.UrlEncode(barcodescale),

Sample encoded url with Barcode Parameters

Https://api.sfaxme.com/api/SendFax?token=dt30cB%2bdiael15kWsQbGOJJhyXDq1IFxZpsbycCSwLglmPs3w6RNs6BqmMuWQEZzPAQ7GXT7e2%2fQHMId%2bdJjXTdkPNy9JO0l3w0YQUphVylo8rG08UsC5IPSNAB4tZ2o&apikey=2F19E15760AD4EDFAF7F70461729114C&RecipientName=Test&RecipientFax=15125314402&BarcodeOption=BarcodeData=ID1949344;BarcodeX=1420;BarcodeY=2000;BarcodePage=1;BarcodeScale=4&BarcodeOption=BarcodeData=Acct-138;BarcodeX=1490;BarcodeY=2012;BarcodePage=1;BarcodeScale=4&OptionalParams=&

Use Case Example:

Two faxes are sent to 2 separate physicians at the same office.   One is for patient Joseph Curry. The other is for patient R.L.    The front desk person at the physicians’ office returns both documents in the same fax, and the pages are mixed up.

When the outbound fax has completed, assuming Fax callbacks are enabled, we will send you the data associated with that fax.

When the fax is returned, assuming Fax Callbacks are enabled, Sfax will send you the callback data to let you know a fax has arrived into your account.  The data will indicate whether or not there is barcode data.  You can then use the FaxId, along with an InboundFaxInfo request to retrieve the barcode data, and/or you may also use the DownloadInbounFaxasPdf or DownloadInboundFaxasTif to download the fax. 

In the example below you will see that the documents were mixed up when returned.  Because a patient id, document id, and page #’s were included in the barcode of each document page, you are able to tell how the document should be ordered, and you are able to confirm that you received all pages.

For this example, the barcode data is being presented as: patient name l patient id l document id l page 1l total number of pages l recipient l recipient fax number

Regarding placement of the barcodes: You should test with your specific documents to find the best placement for the bar code(s).  The larger the bar code the more success we will have reading it when it comes back in.

Regarding size: Due to the nature of faxing, there tends to be quite a bit of degradation, especially when documents are printed, scanned and faxed multiple times.    We tend to see more success using BarcodeScale=5 or higher.

Here is how you would prepare the faxes to go out:

Sent Fax #1: Plan of Care Document

SendFax Request (with Barcode Options and Cover Page)

https://api.sfaxme.com/api/SendFax

&RecipientFax=18557156176
&RecipientName=Dr. Bob
&BarcodeOption=BarcodeX=1500;BarcodeY=1500;BarcodeScale=5;BarcodePage=1;BarcodeData=Curry,Joseph|1465148|13345|1|1|Dr. Bob|855443600
&OptionalParams=CoverPageName=default;CoverPageFromName=Hospital Care;CoverPageFromPhone=1-888-555-1111;CoverPageSubject=Plan Of Care for Curry,Joseph;CoverPageReference=1465148

+ File Attachment

This is what the fax will look like when it goes out (including the Fax cover page).

Sent Fax #2: Visit Note
SendFax Request (with Barcode Options and Cover Page)

https://api.sfaxme.com/api/SendFax

&RecipientFax=18557156176
&RecipientName=Dr. Brown
&BarcodeOption=BarcodeX=1500;BarcodeY=2000;BarcodeScale=5;BarcodePage=1;BarcodeData=R.,L.|1564885|13346|1|3|Dr. Brown|855443600
&BarcodeOption=BarcodeX=1500;BarcodeY=2000;BarcodeScale=5;BarcodePage=2;BarcodeData=R.,L.|1564885|13346|2|3|Dr. Brown|855443600
&BarcodeOption=BarcodeX=1500;BarcodeY=2000;BarcodeScale=5;BarcodePage=3;BarcodeData=R.,L.|1564885|13346|3|3|Dr. Brown|855443600
&OptionalParams=CoverPageName=default;CoverPageFromName=Hospital Care;CoverPageFromPhone=1-888-555-1111;CoverPageSubject=Visit Notes for R.,L.;CoverPageReference=1564885

+ File Attachment

And this is what this fax will look like when it goes out:

In this example, both documents are returned as one fax, and the pages are mixed up, as seen here:


This is what the fax info will look like when it comes in:

If you have  Fax Callbacks configured, this is the info you will get:

Inbound Fax Callback data
Inbound Fax Callback data
&faxtype=1
&faxid=2151021212759980272
&faxsuccess=1
&faxpages=5
&faxdateiso=2015-10-21T21:28:24Z
&faxpwatermarkid=2151021212825997205
&hasbarcodedata=1
&intofaxnumber=18882323562
&infromfaxnumber=8557156176
&infromcpn=8557156176
&infromcsid=8557156176

You will be able to tell that this fax has bar code data associated with it, because &hasbarcodedata=1.  

You can then come back to us and get the Fax Info associated with this fax, which will include the bar code data,  using this service method:

https://api.sfaxme.com/api/InboundFaxInfo?token=5c802wxZLX7LuFu2xbvRCcP1r87TX5P6IpErNPpr2VpGr8QpW5jkZWiE32of%2fKO5ExwJMOf2K6KP%2bGeGkn4DX8F0EgmsZE0CxSXpgxckPOX4dRDd1IPCecBLxVNkw9Yb&apikey=D911F4D4C2B94E00B04C8F3A2AE6E417&FaxId=2151021212759980272

InboundFaxInfo Response

<InboundFaxInfoResponse>
<isSuccess>true</isSuccess>
<inboundFaxItem>
<FaxId>2151021212759980272</FaxId>
<Pages>5</Pages>
<ToFaxNumber>18882323562</ToFaxNumber>
<FromFaxNumber>8557156176</FromFaxNumber>
<FromCSID>8557156176</FromCSID>
<FaxDateUtc>10/21/2015 9:28:24 PM</FaxDateUtc>
<FaxSuccess>1</FaxSuccess>
<Barcodes>
<FirstBarcodePage>2</FirstBarcodePage>
<TotalPagesWithBarcodes>4</TotalPagesWithBarcodes>
<PagesWithBarcodes>
<int>2</int>
<int>3</int>
<int>4</int>
<int>5</int>
</PagesWithBarcodes>
<BarcodeItems>
<BarcodeItem>
<BarcodeData>R.,L.|1564885|13346|1|3|Dr. Brown|855443600</BarcodeData>
<BarcodePage>2</BarcodePage>
</BarcodeItem>
<BarcodeItem>
<BarcodeData>Curry,Joseph|1465148|13345|1|1|Dr. Bob|855443600</BarcodeData>
<BarcodePage>3</BarcodePage>
</BarcodeItem>
<BarcodeItem>
<BarcodeData>R.,L.|1564885|13346|2|3|Dr. Brown|855443600</BarcodeData>
<BarcodePage>4</BarcodePage>
</BarcodeItem>
<BarcodeItem>
<BarcodeData>R.,L.|1564885|13346|3|3|Dr. Brown|855443600</BarcodeData>
<BarcodePage>5</BarcodePage>
</BarcodeItem>
</BarcodeItems>
</Barcodes>
<InboundFaxId>2151021212759980272</InboundFaxId>
<FaxPages>5</FaxPages>
<FaxDateIso>2015-10-21T21:28:24Z</FaxDateIso>
<WatermarkId>2151021212825997205</WatermarkId>
<CreateDateIso>2015-10-21T21:28:24.4277180Z</CreateDateIso>
</inboundFaxItem>
</InboundFaxInfoResponse>

If you would rather poll us than configure the Fax Callbacks, you can use the ReceiveInboundFax method call in the  Service Methods Documentation.

If you would then like to download the fax, you can use one of the Download Service methods listed in the  Service Methods Documentation

If you would like help with your Proof of Concept please give us a call!   877-493-1015 and select Sales.