Skip to content

Set the tape colour of the loaded roll

PUT
/api/v1/printers/{printer_id}/roll
curl --request PUT \
--url https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roll \
--header 'Content-Type: application/json' \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \
--data '{ "colour": "white", "media_raw": "example", "width_mm": 1 }'

Records the tape colour of the roll in the printer and ends the prompt. colour null is both skip and clear. Send the width_mm the operator saw: a roll change detected meanwhile answers 409 roll-changed instead of colouring the new roll.

printer_id
required
Printer Id
string format: uuid
Media typeapplication/json
RollColourUpdate

Body of PUT /printers/{id}/roll.

object
colour
required
Colour

The tape colour; null skips the question and clears a recorded colour

Any of:
string
Allowed values: white yellow green blue red black clear
media_raw
Media Raw

The roll media_raw the operator saw; checked like width_mm when given

Any of:
string
width_mm
Width Mm

Width of the roll the operator saw. When given and different from the stored roll, the call answers 409 roll-changed instead of colouring the new roll.

Any of:
integer

Successful Response

Media typeapplication/json
RollRead

The roll recorded for a printer (GET/PUT /printers/{id}/roll).

object
colour
Colour

Tape colour the operator gave this roll; None if unknown

Any of:
string
Allowed values: white yellow green blue red black clear
media_raw
Media Raw

The media name text of the roll as the printer reported it

Any of:
string
prompt_pending
Prompt Pending

True while the operator is still to be asked for the colour

boolean
set_at
Set At

When the colour was recorded

Any of:
string
width_mm
Width Mm

Width of the roll last seen, in mm

Any of:
integer

Example

{
"colour": "white",
"prompt_pending": false
}

no-roll-loaded: no tape is recorded for the printer. roll-changed: the sent width_mm differs from the stored roll, so the roll changed after the operator looked; ask again.

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