Skip to content

Sessions and playing

A session is one play-through of a story. Players need an account (it can be an anonymous account).

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.)

  1. Init – POST /v2/session/init with { "token": "<voucher token>", "lang": "eng" }. The voucher must be valid (validity period, number of uses, allowed accounts). OnStoryInitialize triggers run.
  2. Start – POST /v2/session/{sessionId}/start with an optional teamName. The start elements are released, OnStoryStart triggers run.
  3. Play – the player processes released elements (see below).
  4. End – POST /v2/session/{sessionId}/end. The session is Finished if the story was completed, otherwise Canceled. A session does not end by itself when the last element is processed.

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).

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.

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.