Zum Inhalt springen

Capabilities of a tape or page printer (cache only)

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

Resolution, media, trays with their calibration and accepted document formats. Served from the status cache: the printer is never contacted, so a printer that has not been probed yet answers 200 with media and captured_at null. No connection detail is part of the answer. A page printer that never answered a probe is reported as unknown (media, document_formats and captured_at null). A tape width without a geometry entry also gives media null. A stale reading or an unpolled printer is reported as unknown too (media null, stale true, captured_at kept). Only enabled trays carry a calibration.

printer_id
required
Printer Id

Printer id.

string format: uuid

Printer id.

Successful Response

Media typeapplication/json
Capabilities

Served from the status cache; the printer is never contacted.

object
captured_at
required
Captured At

When the values were read. A page printer that went offline keeps the time of its last successful reading.

Any of:
string format: date-time
document_formats
required
Document Formats

Page printers only.

Any of:
Array<string>
kind
required
Kind
string
Allowed values: tape page
media
required
Media

None while nothing is known (page printer that never answered), when no tape is loaded, or when the loaded tape width has no geometry entry (tape).

Any of:
TapeMedia
object
printable_mm
required
Printable Mm

Printable_px / dpi_y * 25.4, two decimals.

number
printable_px
required
Printable Px
integer
type
required
Type

Tape type; None while the status cache does not carry it.

Any of:
string
width_mm
required
Width Mm
integer
resolution_dpi
required
Resolution Dpi
Any of:
TapeResolution
object
x
required
X

Dots per inch across the print head.

integer
y
required
Y

Dots per inch along the tape.

integer
stale
Stale

True when the cached reading is older than the status bound or the printer is not polled: media is then null (unknown), captured_at stays so a client can show the age. Same rule as stale on the status endpoint.

boolean
trays
required
Trays

Page printers only.

Any of:
Array<object>
TrayCapability
object
calibration
required

Stored calibration; None while the tray has none or is disabled.

Any of:
CalibrationRead

One enabled tray; the values are None while the tray has no calibration (identity).

object
measured_on
Any of:
MeasuredOn
object
type_key
required
Type Key
string
>= 1 characters <= 200 characters
version
required
Version
integer
>= 1 <= 1000000
method
Method
Any of:
string
offset_x_mm
Offset X Mm
Any of:
number
offset_y_mm
Offset Y Mm
Any of:
number
rotation_deg
Rotation Deg
Any of:
number
scale_x
Scale X
Any of:
number
scale_y
Scale Y
Any of:
number
tray
required
Tray
string
updated_at
Updated At
Any of:
string format: date-time
updated_by
Updated By
Any of:
string
enabled
required
Enabled
boolean
is_default
required
Is Default
boolean
key
required
Key
string
label
required
Label
string
load_hint
required
Load Hint
Any of:
string
media
required
Media

Media the printer reports in this tray, if any.

Any of:
string

Example

{
"kind": "tape",
"stale": false
}

No driver is registered for the tape printer’s model (printer_model_unknown).

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"
}
]
}