Sessions and playing
A session is one play-through of a story. Players need an account (it can be an anonymous account).
Lifecycle
Section titled “Lifecycle”| Status | Meaning |
|---|---|
Initialized |
created with a voucher, not started yet |
Started |
being played |
Finished |
ended after the story was completed |
Canceled |
ended before the story was completed |
(The value NeverFinished exists in the data model but is not set by the backend.)
- Init –
POST /v2/session/initwith{ "token": "<voucher token>", "lang": "eng" }. The voucher must be valid (validity period, number of uses, allowed accounts).OnStoryInitializetriggers run. - Start –
POST /v2/session/{sessionId}/startwith an optionalteamName. The start elements are released,OnStoryStarttriggers run. - Play – the player processes released elements (see below).
- End –
POST /v2/session/{sessionId}/end. The session isFinishedif the story was completed, otherwiseCanceled. A session does not end by itself when the last element is processed.
Playing
Section titled “Playing”The play endpoints identify an element by its session element id – the id of the element’s instance in this session, returned when the element is released – not by the element id of the repository.
| Action | Endpoint | Body |
|---|---|---|
| acknowledge an info | POST /v2/session/{id}/info/acknowledge |
{ "id": "<session element id>" } |
| solve with a secret / QR code | POST /v2/session/{id}/task/solve/secret |
{ "id": …, "secret": "CLOCKWORK" } |
| solve multiple choice | POST /v2/session/{id}/task/solve/mc |
{ "id": …, "text": "24" } |
| solve free text | POST /v2/session/{id}/task/solve/text |
{ "id": …, "text": "368" } |
| solve with position | POST /v2/session/{id}/task/solve/geofence |
{ "id": …, "location": { "lat": …, "lon": … } } |
| solve with user input | POST /v2/session/{id}/task/solve/input |
multipart form: id, text, file |
| skip a task | POST /v2/session/{id}/task/skip |
{ "id": … } |
| list choice options | GET /v2/session/{id}/choice/{sessionElementId}/options |
– |
| make a choice | POST /v2/session/{id}/choice/choose |
{ "id": <session element id>, "choice": "<element id of the option>" } |
| process a dynamic element | POST /v2/session/{id}/dynamic/process |
{ "id": … } |
| collect a coin | POST /v2/session/{id}/coin/collect |
{ "id": "<element id of the coin>", "secret": "GEAR-1" } |
| current state | GET /v2/session/{id} |
– |
Each action answers with the new content: released elements, updated elements and changed variables. The texts are already processed (conditional content is evaluated).
Multiplayer
Section titled “Multiplayer”If the story has multiplayer enabled, other players can join a session and play together as a team. All players of a
session are its attendees.
Operating sessions
Section titled “Operating sessions”Operators of a repository can search, end and delete sessions (/v2/op/{repoId}/session/…) and view the user inputs
of players (/v2/edit/{repoId}/monitoring/input/…). Confirming a user input that requires an operator
(operatorRequired) needs the role Author.