You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/rest-api.md
+82-2Lines changed: 82 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,88 @@ description: >-
6
6
7
7
# REST API
8
8
9
-
{% hint style="danger" %}
10
-
The API of the plugin is currently undocumented and **it will change in version 0.7.0 of this plugin.** From that point onwards I will aim to have a stable, documented API.
9
+
The plugin implements a [SimpleAPI as provided by OctoPrint](https://docs.octoprint.org/en/devel/plugins/mixins.html#simpleapiplugin), which enables external access to the plugin's functionality.
10
+
11
+
It has a single endpoint, supporting a get request and posting a command.
The command to be sent to the plugin. See commands below.
68
+
{% endapi-method-parameter %}
69
+
{% endapi-method-body-parameters %}
70
+
{% endapi-method-request %}
71
+
72
+
{% api-method-response %}
73
+
{% api-method-response-example httpCode=200 %}
74
+
{% api-method-response-example-description %}
75
+
76
+
{% endapi-method-response-example-description %}
77
+
78
+
```javascript
79
+
{
80
+
"lights_on":false,
81
+
"torch_on":false
82
+
}
83
+
```
84
+
{% endapi-method-response-example %}
85
+
{% endapi-method-response %}
86
+
{% endapi-method-spec %}
87
+
{% endapi-method %}
88
+
89
+
{% hint style="info" %}
90
+
See also the [SimpleApi docs](https://docs.octoprint.org/en/devel/plugins/mixins.html#octoprint.plugin.SimpleApiPlugin) for details about how the request should be structured.
0 commit comments