API for partners#
The CoolCMS REST interface. It serves mobile apps, partner systems and custom clients.
Where to start#
- Getting started β your first request in five minutes.
- Authentication β how to get a token.
- Response format β π΄ read this before writing a parser.
- CRUD pattern β reading and writing.
- Error codes.
Address shape#
Optionally with a language prefix: /en/api/β¦. The default language is Czech.
Modules and their resources are in the reference.
π΄ Three things that surprise everybody#
Read them now rather than finding them in a debugger.
1. Parameters go in the URL, not in the request body
Writes included. A POST with a JSON body reads as "missing data". The only
exception is the authentication endpoints, which conversely read a form
body. See the CRUD pattern.
2. Reads and writes return different shapes
A read returns items and _references without a success field. A write
returns an envelope with success. A single parser keyed on success is not
possible. See Response format.
3. Errors arrive with HTTP 200
Validation, "not found" and conflicts alike. Only 401, 403, 429 and 204 are distinguished by status code. See Error codes.
What the API offers#
| Group | Actions |
|---|---|
| Reading | get, get-by, get-all |
| Writing | save, update-columns |
| Deleting | delete, delete-all |
| Trees | move-up, move-down, move-subtree, delete-node |
| Events | register-event |
The specification#
The machine-readable specification is at /api-docs.json, the browser at
/api-docs/.
The specification currently covers only the auth endpoints
Six paths out of several hundred. The rest is described by this manual. Do not rely on a generated client.