Wiki Collaboration
4 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
Keep the collab session alive#
/spaces/{spaceId}/wiki/{pageId}/collab/heartbeatTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
spaceIdPflicht | Pfad | string | – |
pageIdPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
sessionIdPflicht | string | Collab session UUID to keep alive |
Antworten
- 200{ alive }
curl -X POST "https://xapi.ambertech.cloud/api/v1/spaces/{spaceId}/wiki/{pageId}/collab/heartbeat" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sessionId":"…"}'Read the current collab snapshot state#
/spaces/{spaceId}/wiki/{pageId}/collab/snapshotTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
spaceIdPflicht | Pfad | string | – |
pageIdPflicht | Pfad | string | – |
Antworten
- 200Snapshot state (nulls when none)
curl -X GET "https://xapi.ambertech.cloud/api/v1/spaces/{spaceId}/wiki/{pageId}/collab/snapshot" \
-H "Authorization: Bearer $XISUITE_TOKEN"Persist a collab snapshot (CAS on seq + session; supports seed, stale-session takeover, and endSession)#
/spaces/{spaceId}/wiki/{pageId}/collab/snapshotTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
spaceIdPflicht | Pfad | string | – |
pageIdPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
sessionIdPflicht | string | Collab session UUID (owner of the snapshot) |
seqPflicht | number | Expected current snapshot seq (CAS token). The save wins only if the row still carries this seq; the stored seq becomes seq+1. |
ydocStatePflicht | string | Full Yjs document state, base64-encoded (max ~14 MB binary) |
stateVector | string | Yjs state vector, base64-encoded |
contentPflicht | string | Stringified TipTap JSON matching the ydoc state; sanitized and persisted to wiki_pages.content. |
contentText | string | Client-computed plain text (hint only; the server recomputes content_text authoritatively). |
seed | boolean | Seed mode: create the snapshot row iff none exists (409 SEED_CONFLICT when one does). |
endSession | boolean | End the session after saving: clears active_session_id and bumps the page version hint so the trigger cuts a session-end version. |
Antworten
- 200{ seq, updatedAt }
- 409SEED_CONFLICT | SESSION_CONFLICT | SEQ_CONFLICT
curl -X POST "https://xapi.ambertech.cloud/api/v1/spaces/{spaceId}/wiki/{pageId}/collab/snapshot" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sessionId":"…","seq":0,"ydocState":"…","content":"…"}'Mint a Realtime JWT for the page collab channel#
/spaces/{spaceId}/wiki/{pageId}/collab/tokenTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
spaceIdPflicht | Pfad | string | – |
pageIdPflicht | Pfad | string | – |
Antworten
- 200{ token, expiresAt, topic }
curl -X POST "https://xapi.ambertech.cloud/api/v1/spaces/{spaceId}/wiki/{pageId}/collab/token" \
-H "Authorization: Bearer $XISUITE_TOKEN"