@@ -318,16 +318,18 @@ without having to initialize a separate WebSocket connection.
318318
319319A service channel event payload has the following structure:
320320
321- ``` json
322- {
323- "n" : " core" ,
324- "op" : 8 ,
325- "d" : {
326- "action" : " subscribe" ,
327- "service" : " service_name"
328- }
329- }
330- ```
321+ !!! example "Example service channel event payload"
322+
323+ ```json
324+ {
325+ "n": "core",
326+ "op": 8,
327+ "d": {
328+ "action": "subscribe",
329+ "service": "service_name"
330+ }
331+ }
332+ ```
331333
332334| Field | Type | Description |
333335| --------- | ------ | ------------------------------------------------------------------------------------------ |
@@ -337,18 +339,34 @@ A service channel event payload has the following structure:
337339The server must respond with a ` Service Channel ACK ` event payload, indicating whether the action
338340was successful or not.
339341
340- ``` json
341- {
342- "n" : " core" ,
343- "op" : 9 ,
344- "d" : {
345- "action" : " subscribe" ,
346- "service" : " service_name" ,
347- "success" : true ,
348- "message" : " Successfully subscribed to service_name"
349- }
350- }
351- ```
342+ !!! example "Example service channel ACK event payload - failure"
343+
344+ ```json
345+ {
346+ "n": "core",
347+ "op": 9,
348+ "d": {
349+ "action": "subscribe",
350+ "service": "service_name",
351+ "success": false,
352+ "errorMessage": "Service not found"
353+ }
354+ }
355+ ```
356+
357+ !!! example "Example service channel ACK event payload - success"
358+
359+ ```json
360+ {
361+ "n": "core",
362+ "op": 9,
363+ "d": {
364+ "action": "subscribe",
365+ "service": "service_name",
366+ "success": true,
367+ }
368+ }
369+ ```
352370
353371| Field | Type | Description |
354372| --------- | ------- | ------------------------------------------------------------------------------------------ |
@@ -366,15 +384,17 @@ The "New Session" event is sent by the server to all sessions except the new one
366384of this event contains the ASCII-PEM encoded ID-Cert of the new session. You can find more information
367385about the new session mechanism in [ section 4.3] ( #43-protection-against-misuse-by-malicious-home-servers ) .
368386
369- ``` json
370- {
371- "n" : " core" ,
372- "op" : 3 ,
373- "d" : {
374- "cert" : " -----BEGIN CERTIFICATE-----\n MIIBIjANB..."
375- }
376- }
377- ```
387+ !!! example "Example new session event payload"
388+
389+ ```json
390+ {
391+ "n": "core",
392+ "op": 3,
393+ "d": {
394+ "cert": "-----BEGIN CERTIFICATE-----\nMIIBIjANB..."
395+ }
396+ }
397+ ```
378398
379399##### 3.2.3.5 Actor certificate invalidation event
380400
@@ -389,36 +409,49 @@ TODO
389409The server certificate change event notifies clients about a new server ID-Cert. The ` d ` payload
390410of this event contains the ASCII-PEM encoded ID-Cert of the server.
391411
392- ``` json
393- {
394- "n" : " core" ,
395- "op" : 6 ,
396- "d" : {
397- "cert" : " -----BEGIN CERTIFICATE-----\n MIIBIjANB..."
398- }
399- }
400- ```
412+ !!! example "Example server certificate change event payload"
413+
414+ ```json
415+ {
416+ "n": "core",
417+ "op": 6,
418+ "d": {
419+ "cert": "-----BEGIN CERTIFICATE-----\nMIIBIjANB...",
420+ "oldInvalidSince": 1630012713
421+ }
422+ }
423+ ```
424+
425+ | Field | Type | Description |
426+ | ----------------- | ------ | ----------------------------------------------------------------------- |
427+ | ` cert ` | string | ASCII-PEM encoded server ID-Cert. The server ID-Cert is self-signed. |
428+ | ` oldInvalidSince ` | uint64 | A UNIX timestamp indicating when the old server ID-Cert became invalid. |
401429
402430##### 3.2.3.8 Heartbeat and heartbeat ACK events
403431
404432The heartbeat event is sent by the client to the server to keep the WebSocket connection alive.
405433The payload for both the heartbeat and heartbeat ACK events is an empty object ` {} ` .
406434
407- ``` json
408- {
409- "n" : " core" ,
410- "op" : 0 ,
411- "d" : {}
412- }
413- ```
435+ !!! example "Example heartbeat event payload"
436+
414437
415- ``` json
416- {
417- "n" : " core" ,
418- "op" : 7 ,
419- "d" : {}
420- }
421- ```
438+ ```json
439+ {
440+ "n": "core",
441+ "op": 0,
442+ "d": {}
443+ }
444+ ```
445+
446+ !!! example "Example heartbeat ACK event payload"
447+
448+ ```json
449+ {
450+ "n": "core",
451+ "op": 7,
452+ "d": {}
453+ }
454+ ```
422455
423456#### 3.2.4 Establishing a connection
424457
0 commit comments