Skip to content

Print a test label (tape) or a test page (page printer)

POST
/api/v1/printers/{printer_id}/test-print
curl --request POST \
--url https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/test-print \
--header 'Content-Type: application/json' \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \
--data '{ "tray": "example" }'

Prints one test label on a tape printer (printer name, tape width, time, a QR to the printer’s page in the hub) or one test page on a page printer (a frame on the printable area, name, tray, time, a QR). A tape printer is asked at submit time what tape is loaded, so the answer needs no polling; a page printer needs a fresh status.

printer_id
required
Printer Id

Printer id.

string format: uuid

Printer id.

Media typeapplication/json
Body
Any of:
TestPrintRequest
object
tray
Tray

Tray key (page printers only); the default tray when omitted.

Any of:
string
>= 1 characters <= 100 characters

Example generated

{
"tray": "example"
}

Successful Response

Media typeapplication/json
TestPrintAccepted
object
job_id
required
Job Id
string format: uuid

Example generated

{
"job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Unknown printer (printer-not-found).

printer-disabled, printer-paused, printer-status-unknown (page printer the hub does not poll), printer-offline, no-tape-loaded (tape printer), media-unknown (page printer) or printer-unavailable.

tray-invalid: a tray on a tape printer, or an unknown/disabled tray. qr-payload-too-long: the printer link does not fit the fixed QR code of the loaded tape (QL 62 mm).