Get Batch
const url = 'https://example.com/api/v1/batches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'GET', headers: {'X-Label-Hub-Key': '<X-Label-Hub-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/batches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'X-Label-Hub-Key: <X-Label-Hub-Key>'Snapshot eines Batches + aller aktuellen Job-States.
Wird von Hangar’s /admin/print/result/{batch_id} für das initiale
Rendering genutzt. summary.all_terminal == False bedeutet, dass Hangar
den JSON-Stream /api/v1/events verfolgen sollte für
Live-Updates. run shows a tape run that prints, waits for a
confirmation, or stopped (#277).
Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Path Parameters
Abschnitt betitelt „Path Parameters“Responses
Abschnitt betitelt „Responses“Successful Response
object
Serialised view of a Job DB row.
object
object
The tape run while it has something to show (#277).
A tape batch that is printing, waits for a confirmation, or stopped (#277).
Positions are 1-based in print order (job_ids).
object
Labels of an unknown group the user confirmed as printed (a reprint).
The sub-job printing or waiting, 1-based.
The job of every label, in print order.
awaiting_confirmation: the next sub-job starts after POST .../continue. stopped: a group failed; the labels after it were not started. With stop_kind unknown the group’s outcome is unknown (an error while sending, or the status check after the group: on a PT the SNMP noPaper bit at tape end; whether a QL-820NWB reports a DK roll end is not verified); with refused the printer refused before anything was sent (wrong tape, no tape, cover open, unreachable). POST .../reprint picks it up, POST .../discard gives it up. Held runs are kept in memory: a hub restart fails every label that waited for a confirmation (tape_run_interrupted), and a stopped run cannot be reprinted after it.
Where each sub-job starts in job_ids (0-based); a reprint re-splits.
Aggregierte Zähler über alle Jobs eines Batches.
all_terminal wird aus queued + printing berechnet — kein DB-Round-trip nötig. Hangar’s Result-Page nutzt all_terminal um zu entscheiden, ob ein SSE-Stream für Live-Updates geöffnet werden muss.
object
Example
{ "run": { "state": "printing", "stop_kind": "unknown" }, "summary": { "all_terminal": false }}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}