Barcoding
We support barcoding on both sent and received faxes. We can write barcodes in DataMatrix, but we can read DataMatrix as well as PDF417.
NOTE: In general, barcodes should be kept smaller than 400 pixels (2 inches height and width) for DataMatrix and 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 – This parameter is used only to pass information to create a barcode on outgoing-fax pages.
- 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 two 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 two physicians at the same office: One regards patient Joseph Curry; the other, patient R.L. The front-desk person at the physicians’ office returns both documents in the same fax and mixes up the pages as shown below.
However, when the outbound fax has completed then, assuming callbacks are enabled, Sfax can:
- Send you data associated with the account, including callback data to let you know a fax has arrived into your account.
- And, if there is barcode data, you can 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. (For the example shown above, 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.)
- Because a patient ID, document ID, and page numbers are included in in the barcode of each document page, it will indicate how the document should be ordered; and you can also confirm that you received all pages.
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 in reading it when it comes back in.
- 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. However, we see more success in using size BarcodeScale=5 or higher.
How to Prepare Out-Going Faxes
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
...plus a 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
...plus a file attachment. This is what this fax will look like when it goes out:
What Fax Info Looks Like When It Comes In
If you have fax callbacks configured, this is the info you'll get:
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 can tell that this fax has barcode data associated with it, because &hasbarcodedata=1. You can then come back to us and get the info associated with this fax (which includes barcode 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 at 877-493-1015 and select Sales.