API-Referenz

HTTP-GET-Schnittstelle von BE-Code: Basis-Request, optionale Parameter und vollständige Liste der unterstützten Barcode-Typen.

Zweck

Diese Seite beschreibt die HTTP-GET-Schnittstelle von BE-Code vollständig: den Basis-Request, alle optionalen Parameter und die vollständige Liste der unterstützten Barcode-Typen.

Kontext

Die API liefert zu jedem Aufruf ein JSON-Objekt mit zwei Feldern:

{
  "data": "...",
  "message": "..."
}
  • data enthält das Barcode-Bild als base64-kodiertes PNG (mit MIME-Prefix data:image/png;base64,).
  • message enthält eine Statusmeldung zur Anfrage.

Voraussetzungen

  • Eine erreichbare BE-Code-Instanz über HTTPS.
  • Zugriffsdaten für die Basic-Authentication. Zugangsdaten für eine Testinstanz sind auf Anfrage beim BE-terna-Support erhältlich.

Basis-Request

Jeder Aufruf enthält mindestens die Parameter type und content:

  • type: Kurzcode eines Barcode-Typs, z. B. ean13, code128 oder qrcode.
  • content: Zeichenkette, die als Barcode kodiert werden soll.

Beispiel-Request:

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

Beispiel-Antwort (gekürzt):

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

Optionale Parameter für alle Barcode-Typen

  • scaleX: X-Achsen-Skalierung, ganze Zahl > 0, Standard 2.
  • scaleY: Y-Achsen-Skalierung, ganze Zahl > 0, Standard entspricht scaleX.
  • scale: Setzt X- und Y-Skalierung gleichzeitig, ganze Zahl > 0.
  • rotate: Orthogonale Drehung. Mögliche Werte:
    • N: keine Drehung (Standard)
    • R: 90 Grad im Uhrzeigersinn
    • L: 90 Grad gegen den Uhrzeigersinn
    • I: 180 Grad
  • padding: Kurzform für alle vier Padding-Werte.
  • paddingwidth: Kurzform für paddingleft und paddingright.
  • paddingheight: Kurzform für paddingtop und paddingbottom.
  • paddingtop, paddingleft, paddingright, paddingbottom: Padding in Punkten, dreht und skaliert mit dem Bild.
  • backgroundcolor: Hintergrundfarbe als Hex-Wert (RRGGBB oder CCMMYYKK).
  • barcolor: Balken- bzw. Modulfarbe als Hex-Wert (RRGGBB oder CCMMYYKK).
  • parse: Ersetzt Sequenzen wie ^NNN im content durch ihren ASCII-Wert. Nützlich bei code128 oder code39ext, z. B. ^029 für GS oder ^009 für TAB.
    • true: Inhalt parsen
    • false: Inhalt nicht parsen
  • parsefnc: Ermöglicht Nicht-Daten-Funktionszeichen über Escape-Sequenzen wie ^FNC1, ^FNC2, ^FNC3, ^LNKA, ^LNKC.
    • true: Funktionszeichen parsen
    • false: Funktionszeichen nicht parsen

Beispiel-Request mit Gestaltung:

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

Beispiel Code 128 mit Rotation und Farben Zum Vergrößern anklicken

Optionale Parameter für 1D-Barcodes

  • includetext: Zeigt den Inhalt unterhalb des Codes an.
    • true: Text anzeigen
    • false: Text ausblenden
  • textxalign: Ausrichtung des Begleittextes. Mögliche Werte: center, left, right.
  • textfont: Schriftart, Standard arial. Beispiele: CONS, ARIAL.
  • textcolor: Textfarbe als Hex-Wert (RRGGBB oder CCMMYYKK).

Beispiel-Request mit Text:

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

Beispiel Code 128 mit Text Zum Vergrößern anklicken

Optionale Parameter für 2D-Barcodes

  • eclevel: Fehlerkorrektur-Stufe bei QR-Codes. Mögliche Werte:
    • L: niedrig, bis zu 7 % Wiederherstellung
    • M: mittel, bis zu 15 % Wiederherstellung
    • Q: quartile, bis zu 25 % Wiederherstellung
    • H: hoch, bis zu 30 % Wiederherstellung

Beispiel-Request QR-Code mit hoher Fehlerkorrektur und Farben:

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

Beispiel QR-Code Zum Vergrößern anklicken

Unterstützte Barcode-Typen

Kurzcode (type) Bezeichnung
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-stelliger Addon-Code)
ean5 EAN-5 (5-stelliger Addon-Code)
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 Verschiedene Symbole
telepen Telepen
telepennumeric Telepen Numeric
ultracode Ultracode
upca UPC-A
upcacomposite UPC-A Composite
upce UPC-E
upcecomposite UPC-E Composite

Ergebnis

  • Sie können jeden unterstützten Barcode-Typ per GET-Request erzeugen.
  • Sie steuern Skalierung, Drehung, Padding, Farben und optionale 1D-/2D-Parameter gezielt.
  • Die Antwort lässt sich direkt als Bild einbetten.