From 6b23dd9ff1bb8e58612323a1b0b5fc4310818f0a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 17 Oct 2020 10:58:57 -0400 Subject: [PATCH] docs: Provide response_template in subscription examples in API_Server.md Signed-off-by: Kevin O'Connor --- docs/API_Server.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/API_Server.md b/docs/API_Server.md index 9122c806..bb46ce8f 100644 --- a/docs/API_Server.md +++ b/docs/API_Server.md @@ -188,7 +188,8 @@ This endpoint allows one to query and then subscribe to information from printer objects. The endpoint request and response is identical to the "objects/query" endpoint. For example: `{"id": 123, "method": "objects/subscribe", "params": -{"objects":{"toolhead": ["position"], "webhooks": ["state"]}}}` +{"objects":{"toolhead": ["position"], "webhooks": ["state"]}, +"response_template":{}}}` might return: `{"id": 123, "result": {"status": {"webhooks": {"state": "ready"}, "toolhead": {"position": [0.0, 0.0, 0.0, 0.0]}}, @@ -245,7 +246,8 @@ after any pending G-Code commands complete. This endpoint is used to subscribe to G-Code terminal messages that are generated by Klipper. For example: -`{"id": 123, "method": "gcode/subscribe_output"}` +`{"id": 123, "method": "gcode/subscribe_output", "params": +{"response_template":{}}}` might later produce asynchronous messages such as: `{"params": {"response": "// Klipper state: Shutdown"}}`