Protocol sandbox
Every hero, god and creature of myth is a record on the Loom.
Your tasks
A code appears when a task is done – type it into the lesson.
Tasks check what you did, so they need your account.
The Loom of Fate – REST
A JSON REST API under /api with an OpenAPI description. Records 1–20 are shared and read-only; the records you create are yours alone. Writes need a token from sign-in or a personal API key.
| Request | Account | What it does |
|---|---|---|
GET /api/hello | no | A greeting: your first request. |
GET /api/records | no | Records 1–20 and yours. Filter type= (exact: hero, god, creature, titan, mortal), sort id, name_asc, name_desc, newest, page, page_size (up to 50). |
GET /api/records/{id} | no | One record. A missing id, or another student's, answers 404. |
POST /api/records | yes | A record of yours: name and type are required; home, heads, deeds are optional. JSON only, up to 1 KB. |
PUT / PATCH / DELETE /api/records/{id} | yes | PUT replaces the whole record (what you leave out is emptied), PATCH changes the fields you send, DELETE answers 204. Records 1–20 answer 403. |
GET /api/styx | Basic | A gate behind HTTP Basic: username charon, password obol-for-the-ferry – or your own sandbox username and password. |
GET /api/archives | API key | Opens only for a personal key in the X-API-Key header. Make a key below in Your access. |
GET /api/oracle | no | Answers in about 1.5 seconds. |
POST /api/forge, GET /api/forge/{job_id} | yes | Starts a job (202) that is forging for about 5 seconds, then ready. |
/stage/api/… | stage token | The same API as a second environment (Stage): its own records; sign in there with POST /stage/api/auth/login for a stage token. |
Every route, its fields and its answers: Swagger (/openapi.json imports into Postman).
How to call it from your tools
Your first request
Records of one kind, by name
Create a record
Through the Basic gate
The Loom of Fate is a REST API: read the twenty shared records without signing in, then create, change and delete records of your own with your sandbox account. Swagger describes every route; your tools do the rest.
Addresses
Sign in on the right first: most calls need your token- Stage base URL – a second environment
- Swagger (OpenAPI 3) – import into Postman
- REST base URL – sign-in, orders, keys