This commit is contained in:
seb
2026-09-28 06:50:00 +02:00
parent d2aa9ff8b1
commit e8e4265dc4
11 changed files with 747 additions and 116 deletions

View File

@@ -1,13 +1,12 @@
# `PATCH /labeltemplate/{id}`
# `PUT /labeltemplate/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Update label template (partial)
Update label template
Updates specified fields of an existing label template for the selected company.
When `content`, `width`, or `height` is provided, the thumbnail is automatically re-rendered.
Replaces an existing label template.
When `content` (or `width`/`height`) is provided, the thumbnail is automatically re-rendered.
Also available as `PUT /labeltemplate/{id}`.
## Path parameters
@@ -17,47 +16,17 @@ Also available as `PUT /labeltemplate/{id}`.
## Body (JSON)
All fields are optional.
```json
{
"name": "…",
"width": 448,
"height": 200,
"dpi": 203,
"type": "zpl",
"content": {
"objects": []
}
}
{}
```
| Field | Type | Description |
|-------|------|-------------|
| `name` | string | Template name |
| `width` | integer | Canvas width in pixels |
| `height` | integer | Canvas height in pixels |
| `dpi` | integer | Printer DPI — `203` or `300` |
| `type` | string | Template type — `"zpl"` |
| `content` | object | Label editor JSON content |
## Response `200`
Updated label template
```json
{
"labeltemplate": {
"id": 1,
"company_id": 1,
"name": "…",
"width": 448,
"height": 200,
"dpi": 203,
"type": "zpl",
"content": {},
"thumb": "…"
}
"labeltemplate": {}
}
```