Skip to content

Images

Img API provides a way to generate images from templates, barcodes, and QR codes.

Get SVG file based on template

HTTP
curl {{host}}/api/core/img/svg/{{appname}}/{{svgtemplate}} \
-H "Authorization: Token {{token}}"

Note

  • svgtemplate - template without extension
  • Templates are stored in templates/filename.svg folder
  • app_name - www - for system templates
  • {key} - template keys are replaced with values from query string

Get Barcode from text

Maximum character length is 80 characters. If less than 23 characters

HTTP
curl {{host}}/api/core/img/barcode?code={{code}} \
-H "Authorization: Token {{token}}"

HTML

HTML
<img src="/api/core/img/barcode?code={code}&width=350" class="xs-image"  alt="Barcode">
Markdown
![Barcode](/api/core/img/barcode?code={code})

Barcode API will generate Code128 Barcode , query parameters

  • code - Valid EAN 128 CODE
  • l - label true/false , default true
  • w - set the width of the barcode, default 300
  • h - set height default 60

Get QRCode from text

HTTP
curl {{host}}/api/core/img/qrcode?code={{code}} \
-H "Authorization: Token {{token}}"
HTML
<img src="/api/core/img/qrcode?code={code}" class="xd-image"/>
Markdown
![QRCODE](/api/core/img/qrcode?code={code})