1.8 KiB
1.8 KiB
PUT /labeltemplate/{id}
Protected. Requires a valid session cookie (credentials: 'include').
Update label template
Replaces an existing label template.
When content (or width/height) is provided, the thumbnail is automatically re-rendered.
Path parameters
| Param | Required | Type | Description |
|---|---|---|---|
id |
yes | integer | Label template ID |
Body (JSON)
| Field | Required | Type | Description |
|---|---|---|---|
name |
no | string | |
width |
no | number | |
height |
no | number | |
dpi |
no | integer | |
type |
no | string | |
content |
no | LabelContent |
{
"name": "…",
"width": 1,
"height": 1,
"dpi": 1,
"type": "…",
"content": {
"objects": [
{
"id": "…",
"type": "textbox",
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"text": "…",
"font": "…",
"fontSize": 1,
"barcodeFormat": "EAN8"
}
]
}
}
Response 200
Updated label template
{
"labeltemplate": {
"id": 1,
"name": "…",
"width": 1,
"height": 1,
"dpi": 1,
"type": "…",
"content": {
"objects": [
{
"id": "…",
"type": "textbox",
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"text": "…",
"font": "…",
"fontSize": 1,
"barcodeFormat": "EAN8"
}
]
},
"thumb": "…"
}
}
Errors
| Status | Description |
|---|---|
| 400 | Invalid input — {"error":"…"} |
| 401 | Unauthorized — {"error":"…"} |
| 404 | Label template not found — {"error":"…"} |
Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.