API reference

HTTP GET interface for BE-Code: base request, optional parameters, and the complete list of supported barcode types.

Purpose

This page documents the HTTP GET interface of BE-Code in full: the base request, all optional parameters, and the complete list of supported barcode types.

Context

Every call returns a JSON object with two fields:

{
  "data": "...",
  "message": "..."
}
  • data contains the barcode image as a base64-encoded PNG (with the data:image/png;base64, MIME prefix).
  • message carries a status message for the request.

Prerequisites

  • A BE-Code instance reachable over HTTPS.
  • Basic authentication credentials. Credentials for a test instance are available from BE-terna support on request.

Base request

Every call includes at least the parameters type and content:

  • type: short code of a barcode type, for example ean13, code128, or qrcode.
  • content: string to encode.

Example request:

https://<fqdn>:1880/becode?content=www.be-terna.com&type=qrcode

Example response (truncated):

{
  "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAA...",
  "message": "success"
}

Optional parameters for all barcode types

  • scaleX: X-axis scale, integer > 0, default 2.
  • scaleY: Y-axis scale, integer > 0, default equals scaleX.
  • scale: Sets both X and Y scale at once, integer > 0.
  • rotate: Orthogonal rotation. Allowed values:
    • N: no rotation (default)
    • R: 90 degrees clockwise
    • L: 90 degrees counter-clockwise
    • I: 180 degrees
  • padding: Shorthand for all four padding values.
  • paddingwidth: Shorthand for paddingleft and paddingright.
  • paddingheight: Shorthand for paddingtop and paddingbottom.
  • paddingtop, paddingleft, paddingright, paddingbottom: Padding in points; rotates and scales with the image.
  • backgroundcolor: Background color as a hex value (RRGGBB or CCMMYYKK).
  • barcolor: Bar or module color as a hex value (RRGGBB or CCMMYYKK).
  • parse: Replaces sequences such as ^NNN in content with their ASCII value. Useful for code128 or code39ext, for example ^029 for GS or ^009 for TAB.
    • true: parse content
    • false: do not parse content
  • parsefnc: Enables non-data function characters via escape sequences such as ^FNC1, ^FNC2, ^FNC3, ^LNKA, ^LNKC.
    • true: parse function characters
    • false: do not parse function characters

Example request with styling:

https://<fqdn>:1880/becode?content=www.be-terna.com&type=code128&scale=1&rotate=R&paddingtop=10&paddingbottom=10&backgroundcolor=E6E6FA&barcolor=FF0000

Example Code 128 with rotation and colors Click to enlarge

Optional parameters for 1D barcodes

  • includetext: Shows the content below the code.
    • true: show text
    • false: hide text
  • textxalign: Text alignment. Allowed values: center, left, right.
  • textfont: Font, default arial. Examples: CONS, ARIAL.
  • textcolor: Text color as a hex value (RRGGBB or CCMMYYKK).

Example request with text:

https://<fqdn>:1880/becode?content=www.be-terna.com&type=code128&includetext=true&textxalign=center&textfont=CONS&textcolor=E6E6FA

Example Code 128 with text Click to enlarge

Optional parameters for 2D barcodes

  • eclevel: Error-correction level for QR codes. Allowed values:
    • L: low, up to 7 % recovery
    • M: medium, up to 15 % recovery
    • Q: quartile, up to 25 % recovery
    • H: high, up to 30 % recovery

Example request for a QR code with high error correction and colors:

https://<fqdn>:1880/becode?content=www.be-terna.com&type=qrcode&eclevel=H&backgroundcolor=E6E6FA&barcolor=FF0000

Example QR code Click to enlarge

Supported barcode types

Short code (type) Name
auspost AusPost 4 State Customer Code
azteccode Aztec Code
azteccodecompact Compact Aztec Code
aztecrune Aztec Runes
bc412 BC412
channelcode Channel Code
codablockf Codablock F
code11 Code 11
code128 Code 128
code16k Code 16K
code2of5 Code 25
code32 Italian Pharmacode
code39 Code 39
code39ext Code 39 Extended
code49 Code 49
code93 Code 93
code93ext Code 93 Extended
codeone Code One
coop2of5 COOP 2 of 5
daft Custom 4 state symbology
databarexpanded GS1 DataBar Expanded
databarexpandedcomposite GS1 DataBar Expanded Composite
databarexpandedstacked GS1 DataBar Expanded Stacked
databarexpandedstackedcomposite GS1 DataBar Expanded Stacked Composite
databarlimited GS1 DataBar Limited
databarlimitedcomposite GS1 DataBar Limited Composite
databaromni GS1 DataBar Omnidirectional
databaromnicomposite GS1 DataBar Omnidirectional Composite
databarstacked GS1 DataBar Stacked
databarstackedcomposite GS1 DataBar Stacked Composite
databarstackedomni GS1 DataBar Stacked Omnidirectional
databarstackedomnicomposite GS1 DataBar Stacked Omnidirectional Composite
databartruncated GS1 DataBar Truncated
databartruncatedcomposite GS1 DataBar Truncated Composite
datalogic2of5 Datalogic 2 of 5
datamatrix Data Matrix
datamatrixrectangular Data Matrix Rectangular
datamatrixrectangularextension Data Matrix Rectangular Extension
dotcode DotCode
ean13 EAN-13
ean13composite EAN-13 Composite
ean14 GS1-14
ean2 EAN-2 (2-digit add-on)
ean5 EAN-5 (5-digit add-on)
ean8 EAN-8
ean8composite EAN-8 Composite
flattermarken Flattermarken
gs1-128 GS1-128
gs1-128composite GS1-128 Composite
gs1-cc GS1 Composite 2D Component
gs1datamatrix GS1 Data Matrix
gs1datamatrixrectangular GS1 Data Matrix Rectangular
gs1northamericancoupon GS1 North American Coupon
gs1qrcode GS1 QR Code
hanxin Han Xin Code
hibcazteccode HIBC Aztec Code
hibccodablockf HIBC Codablock F
hibccode128 HIBC Code 128
hibccode39 HIBC Code 39
hibcdatamatrix HIBC Data Matrix
hibcdatamatrixrectangular HIBC Data Matrix Rectangular
hibcmicropdf417 HIBC MicroPDF417
hibcpdf417 HIBC PDF417
hibcqrcode HIBC QR Code
iata2of5 IATA 2 of 5
identcode Deutsche Post Identcode
industrial2of5 Industrial 2 of 5
interleaved2of5 Interleaved 2 of 5 (ITF)
isbn ISBN
ismn ISMN
issn ISSN
itf14 ITF-14
japanpost Japan Post 4 State Customer Code
kix Royal Dutch TPG Post KIX
leitcode Deutsche Post Leitcode
mailmark Royal Mail Mailmark
matrix2of5 Matrix 2 of 5
maxicode MaxiCode
micropdf417 MicroPDF417
microqrcode Micro QR Code
msi MSI Modified Plessey
onecode USPS Intelligent Mail
pdf417 PDF417
pdf417compact Compact PDF417
pharmacode Pharmaceutical Binary Code
pharmacode2 Two-track Pharmacode
planet USPS PLANET
plessey Plessey UK
posicode PosiCode
postnet USPS POSTNET
pzn Pharmazentralnummer (PZN)
qrcode QR Code
rationalizedCodabar Codabar
raw Custom 1D symbology
royalmail Royal Mail 4 State Customer Code
sscc18 SSCC-18
symbol Miscellaneous symbols
telepen Telepen
telepennumeric Telepen Numeric
ultracode Ultracode
upca UPC-A
upcacomposite UPC-A Composite
upce UPC-E
upcecomposite UPC-E Composite

Outcome

  • You can generate any supported barcode type with a single GET request.
  • You control scaling, rotation, padding, colors, and optional 1D/2D parameters explicitly.
  • The response embeds directly as an image.