Set the tape colour of the loaded roll
PUT
/api/v1/printers/{printer_id}/roll
const url = 'https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roll';const options = { method: 'PUT', headers: {'X-Label-Hub-Key': '<X-Label-Hub-Key>', 'Content-Type': 'application/json'}, body: '{"colour":"white","media_raw":"example","width_mm":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”printer_id
required
Printer Id
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
RollColourUpdate
Body of PUT /printers/{id}/roll.
object
colour
required
media_raw
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
RollRead
The roll recorded for a printer (GET/PUT /printers/{id}/roll).
object
media_raw
prompt_pending
Prompt Pending
True while the operator is still to be asked for the colour
boolean
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>
ValidationErrorobject
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" } ]}