summaryrefslogtreecommitdiff
path: root/docs/api/boot.md
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-06-18 23:33:02 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-06-20 22:27:35 -0400
commit4b522c804db8155f74a734c95ed962d996b2c692 (patch)
treef5369ba821ba22cdd307b7a3a411e95ad1a1e896 /docs/api/boot.md
parent057bbef5f37a4051615ad23661a0b4853b61162e (diff)
Include historical events in the boot response.
The returned events are all events up to and including the `resume_point` in the same response. If combined with the events from `/api/events?resume_point=x`, using the same `resume_point`, the client will have a complete event history, less any events from histories that have been purged.
Diffstat (limited to 'docs/api/boot.md')
-rw-r--r--docs/api/boot.md58
1 files changed, 56 insertions, 2 deletions
diff --git a/docs/api/boot.md b/docs/api/boot.md
index 7e3dda3..1f6e619 100644
--- a/docs/api/boot.md
+++ b/docs/api/boot.md
@@ -21,8 +21,8 @@ sequenceDiagram
Client initialization serves three purposes:
- It confirms that the client's [identity token](./authentication.md) is valid, and tells the client what user that token is associated with.
-- It provides an initial snapshot of the state of the service.
-- It provides a resume point for the [event stream](./events.md), which allows clients to consume events starting from the moment the snapshot was created.
+- It provides an initial event collection.
+- It provides a resume point for the [event stream](./events.md), which allows clients to consume events starting after the initial event collection.
## `GET /api/boot`
@@ -43,6 +43,56 @@ This endpoint will respond with a status of
},
"resume_point": 1312,
"heartbeat": 30,
+ "events": [
+ {
+ "type": "user",
+ "event": "created",
+ "at": "2025-04-14T23:58:10.421901Z",
+ "id": "U1234abcd",
+ "name": "example username"
+ },
+ {
+ "type": "channel",
+ "event": "created",
+ "at": "2025-04-14T23:58:11.421901Z",
+ "id": "C1234abcd",
+ "name": "nonsense and such"
+ },
+ {
+ "type": "message",
+ "event": "sent",
+ "at": "2024-09-27T23:19:10.208147Z",
+ "channel": "C1234abcd",
+ "sender": "U1234abcd",
+ "id": "M1312acab",
+ "body": "beep"
+ },
+ {
+ "type": "message",
+ "event": "sent",
+ "at": "2025-06-19T15:14:40.431627Z",
+ "channel": "Ccfdryfdb4krpy77",
+ "sender": "U888j6fyc8ccrnkf",
+ "id": "Mc6jk823wjc82734",
+ "body": "test"
+ },
+ {
+ "type": "channel",
+ "event": "created",
+ "at": "2025-06-19T15:14:44.764263Z",
+ "id": "C2d9y6wckph3n36x",
+ "name": "noob"
+ },
+ {
+ "type": "message",
+ "event": "sent",
+ "at": "2025-06-19T15:29:47.376455Z",
+ "channel": "Ccfdryfdb4krpy77",
+ "sender": "U888j6fyc8ccrnkf",
+ "id": "M3twnj7rfk2ph744",
+ "body": "test"
+ }
+ ],
"users": [
{
"id": "U1234abcd",
@@ -75,10 +125,14 @@ The response will include the following fields:
| `user` | object | The details of the caller's identity. |
| `resume_point` | integer | A resume point for [events](./events.md), such that the event stream will begin immediately after the included snapshot. |
| `heartbeat` | integer | The [heartbeat timeout](./events.md#heartbeat-events), in seconds, for events. |
+| `events` | array of object | The events on the server up to the resume point. |
| `users` | array of object | A snapshot of the users present in the service. |
| `channels` | array of object | A snapshot of the channels present in the service. |
| `messages` | array of object | A snapshot of the messages present in the service. |
+Each element of the
+`events` object is an event, as described in [Events](./events.md). Events are provided in the same order as they would appear in the event stream response.
+
The `user` object will include the following fields:
| Field | Type | Description |