Files
dashback/docs/api/routes/article/history.md
2026-10-23 22:22:30 +02:00

64 lines
1.6 KiB
Markdown

# `GET /article/{sku}/history`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Get article history by SKU
Returns `articlehistory` rows for the article, newest first (`date` DESC, `id` DESC).
Supports pagination, search filter, and date cutoff via `seekMonths`.
Auth like GET by SKU.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `sku` | yes | string | Article SKU |
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `offset` | no | integer | Paging offset |
| `limit` | no | integer | Page size |
| `search` | no | string | Optional search filter for history text |
| `seekMonths` | no | integer | Negative integer cutoff months ago (e.g. -13) |
## Response `200`
Paged article history list
```json
{
"history": [
{
"id": 42,
"date": "2026-08-05T07:15:00.000Z",
"text": "Name geändert von \"Tee\" auf \"Grüner Tee\"\nEinheit geändert von \"500g\" auf \"1kg\""
},
{
"id": 41,
"date": "2026-08-01T09:00:00.000Z",
"text": "Name geändert von \"\" auf \"Tee\""
}
],
"total": 2,
"unfilteredTotal": 2,
"offset": 0,
"limit": 50
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Missing sku or invalid query parameters — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Article not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._