From f91df003fe85803954a88cff42b0a3646bd512f6 Mon Sep 17 00:00:00 2001 From: chme Date: Tue, 22 Jan 2019 09:24:14 +0100 Subject: [PATCH] [README] Update JSON API documentation - api/player/toggle - api/player/volume --- README_JSON_API.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README_JSON_API.md b/README_JSON_API.md index 412e0d71..df9f7497 100644 --- a/README_JSON_API.md +++ b/README_JSON_API.md @@ -23,7 +23,7 @@ JSON-Object model: | Method | Endpoint | Description | | --------- | ------------------------------------------------ | ------------------------------------ | | GET | [/api/player](#get-player-status) | Get player status | -| PUT | [/api/player/play, /api/player/pause, /api/player/stop](#control-playback) | Start, pause or stop playback | +| PUT | [/api/player/play, /api/player/pause, /api/player/stop, /api/player/toggle](#control-playback) | Start, pause or stop playback | | PUT | [/api/player/next, /api/player/prev](#skip-tracks) | Skip forward or backward | | PUT | [/api/player/shuffle](#set-shuffle-mode) | Set shuffle mode | | PUT | [/api/player/consume](#set-consume-mode) | Set consume mode | @@ -93,6 +93,10 @@ PUT /api/player/pause PUT /api/player/stop ``` +```http +PUT /api/player/toggle +``` + **Response** On success returns the HTTP `204 No Content` success status response code. @@ -111,6 +115,10 @@ curl -X PUT "http://localhost:3689/api/player/pause" curl -X PUT "http://localhost:3689/api/player/stop" ``` +```shell +curl -X PUT "http://localhost:3689/api/player/toggle" +``` + ### Skip tracks @@ -240,8 +248,10 @@ PUT /api/player/volume | Parameter | Value | | --------------- | ----------------------------------------------------------- | | volume | The new volume (0 - 100) | +| step | The increase or decrease volume by the given amount (-100 - 100) | | output_id | *(Optional)* If an output id is given, only the volume of this output will be changed. If parameter is omited, the master volume will be changed. | +Either `volume` or `step` must be present as query parameter **Response** @@ -253,6 +263,10 @@ On success returns the HTTP `204 No Content` success status response code. curl -X PUT "http://localhost:3689/api/player/volume?volume=50" ``` +```shell +curl -X PUT "http://localhost:3689/api/player/volume?step=-5" +``` + ```shell curl -X PUT "http://localhost:3689/api/player/volume?volume=50&output_id=0" ```