Create a sheet, with the cells already used marked by hand
const url = 'https://example.com/api/v1/sheets';const options = { method: 'POST', headers: {'X-Label-Hub-Key': '<X-Label-Hub-Key>', 'Content-Type': 'application/json'}, body: '{"id_placement":"cell","note":"example","printer":"example","tray":"example","type":"example","used_cells":[],"version":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/sheets \ --header 'Content-Type: application/json' \ --header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \ --data '{ "id_placement": "cell", "note": "example", "printer": "example", "tray": "example", "type": "example", "used_cells": [], "version": 1 }'id_placement margin (the default) and manual only store the sheet. cell also reserves the first free cell for the sheet ID label and queues an ID-only job on the named page printer; job_id names it. If the job cannot be queued, the sheet stays without a reservation and the ID goes onto the next job’s first free cell; the error names the sheet in error_detail.sheet_code.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Where the sheet ID goes. margin (the default) and manual only store the sheet; the margin ID is printed by the first job that prints onto it. cell needs a page printer: it reserves the first free cell for the ID label and queues an ID-only job (job_id in the response).
Responses
Section titled “Responses”Successful Response
The response of POST /api/v1/sheets: the sheet and the ID-only job of a cell sheet.
object
Every cell that is not free, by cell number.
object
Whether the cell holds the sheet’s ID label (the hub fills it). Set by the hub; do not infer it from source.
Whether the feed-direction mark has been printed on this sheet.
Geometry of the version the sheet is pinned to.
object
Example
{ "cells": [ { "state": "reserved" } ], "geometry": { "page_size": "A4", "shape": "rectangle" }, "id_placement": "cell", "state": "active"}These credentials may not use the printer.
Sheet type or printer not found.
Sheet type is archived, no cell is free for the ID (insufficient_cells), the printer is disabled (printer_disabled) or unknown to the queue.
A cell number is outside the sheet, or cell without a printer.
The ID-only job was queued only partly (print_interrupted).