API section
Labels
Labels and price tags from templates: preview as an image and printing on the label printer.
| POST | /api/v1/labels/{name}/render | Fill in data |
| POST | /api/v1/labels/{name}/print | Print a label |
| GET | /api/v1/labels | Label templates |
| GET | /api/v1/labels/{name} | Label template |
Fill in data#
POST
/api/v1/labels/{name}/renderCommands with the fields filled in — to see what goes to the printer; does not print
Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string |
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"}'Template with data — to a driverless printer (device) or a Windows printer in RAW mode
Parameters
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string | |
Idempotency-Keyrequired | header | string | |
Prefer | header | string |
Request body application/json required
Fields · LabelPrintRequest
datamap → stringdeviceinteger int32printerstringrolestringcopiesinteger int32from 1to 100
JSON
{
"data": {
"key": "string"
},
"device": 1,
"printer": "string",
"role": "string",
"copies": 1
}Response 200 application/json
Fields · Operation
idstring uuidtypestringidempotencyKeystringresourcesarray of stringstatusstringvalues:QUEUEDRUNNINGSUCCEEDEDFAILEDUNKNOWNstagestringcreatedAtstring date-timestartedAtstring date-timefinishedAtstring date-timeresultany valueerrorOperationError3 fields · OperationError
codestringmessagestringdetailsany value
warningsarray of string
Errors — problem+json with a code field, see error codes.
Request example
curl
curl -X POST 'http://localhost:7790/api/v1/labels/PRICE/print' \
-H 'Idempotency-Key: $(uuidgen)' \
-H 'Prefer: wait=30' \
-H 'Content-Type: application/json' \
--data '{"data":{"key":"string"},"device":1,"printer":"string","role":"string","copies":1}'curl
curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/labels/PRICE/print' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Idempotency-Key: $(uuidgen)' \
-H 'Prefer: wait=30' \
-H 'Content-Type: application/json' \
--data '{"data":{"key":"string"},"device":1,"printer":"string","role":"string","copies":1}'Label templates#
GET
/api/v1/labelsBuilt-in examples (ZPL, TSPL, EZPL, ESC/POS) and your own templates from data/labels
Response 200 application/json
Array · Label
namestringtitlestringlanguagestringvalues:ZPLTSPLEZPLESCPOScharsetstringdescriptionstringbodystringsamplemap → stringbuiltInbooleanfieldsarray 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
| Name | In | Type | Description |
|---|---|---|---|
namerequired | path | string |
Response 200 application/json
Fields · Label
namestringtitlestringlanguagestringvalues:ZPLTSPLEZPLESCPOScharsetstringdescriptionstringbodystringsamplemap → stringbuiltInbooleanfieldsarray 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'