mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-28 17:57:05 +02:00
Fix markdown for json rpc api documentation, minor improvement to api documentation (#716)
* Fix markdown typo * Fix a markdown type (duplicate ```), add an example with a string as jsonrpc id to make it clear that not only integers are supported * Improve JSON RPC id documentation
This commit is contained in:
parent
0c2afa6233
commit
8d4db0062f
1 changed files with 9 additions and 4 deletions
|
@ -101,6 +101,11 @@ WebSockets receive Notifications of events. Connect a client, and you will event
|
|||
The client that sends a "Set" command will receive a Response, while the other connected control clients will receive a Notification "On" event.
|
||||
Commands can be sent in a [Batch](http://www.jsonrpc.org/specification#batch). The server will reply with a Batch and send a Batch notification to the other clients. This way the volume of multiple Snapclients can be changed with a single Batch Request.
|
||||
|
||||
Each JSON RPC request and response contains an identifier in the `id` field, which can be used to link responses to the request that caused them, as defined in the JSON RPC specification:
|
||||
|
||||
An identifier established by the Client that MUST contain a String, Number, or NULL value if included.
|
||||
If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
|
||||
|
||||
Clients should call `Server.GetStatus` to get the complete picture.
|
||||
|
||||
The Server JSON object contains a list of Groups and Streams. Every Group holds a list of Clients and a reference to a Stream. Clients, Groups and Streams are referenced in the "Set" commands by their `id`.
|
||||
|
@ -185,12 +190,12 @@ The Server JSON object contains a list of Groups and Streams. Every Group holds
|
|||
### Client.SetVolume
|
||||
#### Request
|
||||
```json
|
||||
{"id":8,"jsonrpc":"2.0","method":"Client.SetVolume","params":{"id":"00:21:6a:7d:74:fc","volume":{"muted":false,"percent":74}}}
|
||||
{"id":"8","jsonrpc":"2.0","method":"Client.SetVolume","params":{"id":"00:21:6a:7d:74:fc","volume":{"muted":false,"percent":74}}}
|
||||
```
|
||||
|
||||
#### Response
|
||||
```json
|
||||
{"id":8,"jsonrpc":"2.0","result":{"volume":{"muted":false,"percent":74}}}
|
||||
{"id":"8","jsonrpc":"2.0","result":{"volume":{"muted":false,"percent":74}}}
|
||||
```
|
||||
|
||||
#### Notification
|
||||
|
@ -385,7 +390,7 @@ The Server JSON object contains a list of Groups and Streams. Every Group holds
|
|||
|
||||
### Client.OnVolumeChanged
|
||||
```json
|
||||
{"jsonrpc":"2.0","method":"Client.OnVolumeChanged","params":{"id":"00:21:6a:7d:74:fc","volume":{"muted":false,"percent":74}}}```
|
||||
{"jsonrpc":"2.0","method":"Client.OnVolumeChanged","params":{"id":"00:21:6a:7d:74:fc","volume":{"muted":false,"percent":74}}}
|
||||
```
|
||||
|
||||
### Client.OnLatencyChanged
|
||||
|
@ -410,7 +415,7 @@ The Server JSON object contains a list of Groups and Streams. Every Group holds
|
|||
|
||||
### Group.OnNameChanged
|
||||
```json
|
||||
{"jsonrpc":"2.0","method":"GrClient.OnNameChanged","params":{"id":"4dcc4e3b-c699-a04b-7f0c-8260d23c43e1","name":"GroundFloor"}}
|
||||
{"jsonrpc":"2.0","method":"Group.OnNameChanged","params":{"id":"4dcc4e3b-c699-a04b-7f0c-8260d23c43e1","name":"GroundFloor"}}
|
||||
```
|
||||
|
||||
### Stream.OnUpdate
|
||||
|
|
Loading…
Add table
Reference in a new issue