Appearance
Rokfor CMS API Documentation
REST API for the Rokfor CMS backend. Built with Koa.js + TypeScript, persisting data via MikroORM (MariaDB/MySQL).
Quick Start
- Obtain a JWT token (see Authentication)
- Make API requests with
Authorization: Bearer <token> - Use the Query Syntax for filtering and pagination
API Endpoints
Content
- Collection — Query, create, update, and delete content entries in bulk
- Item — Single content entry operations
- File Uploads — Uploading binaries to
Bildfields via multipart/form-data
Structure
- Books — Top-level publications
- Chapters — Chapters (sections within books)
- Issues — Issues (editions/volumes within books)
Configuration
- Templates — Template groups (content types)
- Fields — Template field definitions
- Exporters — Export plugins and PDF generation
Administration
Reference
- Authentication — Auth methods, tokens, roles
- Query Syntax — Filtering, sorting, pagination
- Schema Endpoints — Dynamic schema introspection
Base URL
http://localhost:{SERVER_PORT}/apiDomain Model
Books (publication)
├── Issues (editions/volumes)
│ └── Contributions (content entries)
│ └── Data (individual field values)
└── Chapters (sections)
└── Contributions (content entries)
Templatenames (template group / content type)
└── Templates (field definitions)
Rights → links Users to Books / Issues / Chapters / TemplatesCaching / Conditional Requests
All responses include an ETag header. Clients can use conditional requests to avoid re-downloading unchanged data:
- Store the
ETagvalue from a response - On subsequent requests, send it as
If-None-Match:
GET /api/collection/articles
If-None-Match: "abc123"If the content hasn't changed, the server responds with 304 Not Modified and an empty body, saving bandwidth and processing time.
Response Format
All endpoints return JSON. List endpoints return:
json
{
"items": [...],
"_count": 42,
"_limit": 1000,
"_offset": 0
}Single-entity endpoints return the entity object directly.
Error responses:
json
{
"error": "Error message"
}