HW agent API 2.15.3

API section

Labels

Labels and price tags from templates: preview as an image and printing on the label printer.

POST/api/v1/labels/{name}/renderFill in data
POST/api/v1/labels/{name}/printPrint a label
GET/api/v1/labelsLabel templates
GET/api/v1/labels/{name}Label template

Fill in data#

POST/api/v1/labels/{name}/render

Commands with the fields filled in — to see what goes to the printer; does not print

Parameters

NameInTypeDescription
namerequiredpathstring

Request body application/json

Type: map → string

JSON
{
  "key": "string"
}

Response 200 application/json

Fields · Rendered
  • textstring

Errors — problem+json with a code field, see error codes.

Request example

curl
curl -X POST 'http://localhost:7790/api/v1/labels/PRICE/render' \
  -H 'Content-Type: application/json' \
  --data '{"key":"string"}'
curl
curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/labels/PRICE/render' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42' \
  -H 'Content-Type: application/json' \
  --data '{"key":"string"}'

Label templates#

GET/api/v1/labels

Built-in examples (ZPL, TSPL, EZPL, ESC/POS) and your own templates from data/labels

Response 200 application/json

Array · Label
  • namestring
  • titlestring
  • languagestring
    values: ZPL TSPL EZPL ESCPOS
  • charsetstring
  • descriptionstring
  • bodystring
  • samplemap → string
  • builtInboolean
  • fieldsarray of string

Errors — problem+json with a code field, see error codes.

Request example

curl
curl 'http://localhost:7790/api/v1/labels'
curl
curl 'https://cloud.hw-connector.ru/agent/api/v1/labels' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42'

Label template#

GET/api/v1/labels/{name}

Parameters

NameInTypeDescription
namerequiredpathstring

Response 200 application/json

Fields · Label
  • namestring
  • titlestring
  • languagestring
    values: ZPL TSPL EZPL ESCPOS
  • charsetstring
  • descriptionstring
  • bodystring
  • samplemap → string
  • builtInboolean
  • fieldsarray of string

Errors — problem+json with a code field, see error codes.

Request example

curl
curl 'http://localhost:7790/api/v1/labels/PRICE'
curl
curl 'https://cloud.hw-connector.ru/agent/api/v1/labels/PRICE' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42'