Skip to content

Get the tape loaded in a printer

GET
/api/v1/printers/{printer_id}/tape
curl --request GET \
--url https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/tape \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>'

Returns the width, display label and raw media text of the tape loaded in the printer, read from the status cache that the SNMP status producer writes. colour comes from the operator’s roll record and is null until one exists. Answers 404 when there is no tape to report; see the 404 response.

printer_id
required
Printer Id
string format: uuid

Successful Response

Media typeapplication/json
TapeRead

The tape loaded in a polled tape printer (GET /printers/{id}/tape).

object
colour
Colour

Tape colour from the operator’s roll record; None if unknown

Any of:
string
Allowed values: white yellow green blue red black clear
label
required
Label

Display label from the printer model, e.g. “62mm DK”

string
media_raw
Media Raw

The media name text as the printer reported it

Any of:
string
width_mm
required
Width Mm

Width of the loaded tape in mm

integer

Example

{
"colour": "white"
}

No tape to report: the printer is unknown, has no cached status (no cached status for printer ...), is not polled (Not polled), its status is stale (Status older than N s, as in the status note), it is offline (printer offline: the hub cannot see a tape through a printer it cannot reach), or no tape is loaded (no tape loaded in printer ...). The body is {"detail": "<text>"}.

Media typeapplication/json
DetailError

The error body the routes actually send: FastAPI’s {"detail": "<text>"}.

Routes raise HTTPException(status, detail="<text>"); this is the model that describes that body in OpenAPI. It is not :class:ProblemDetail, which no route sends.

object
detail
required
Detail

Human-readable explanation of the error

string

Example generated

{
"detail": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}