Skip to content

Commit b464b7f

Browse files
LKuemmelbenderl
andauthored
link to http api pdf (#657)
* link to http api pdf * Update src/views/GeneralConfig.vue Co-authored-by: benderl <[email protected]> --------- Co-authored-by: benderl <[email protected]>
1 parent 294141e commit b464b7f

File tree

1 file changed

+10
-62
lines changed

1 file changed

+10
-62
lines changed

src/views/GeneralConfig.vue

+10-62
Original file line numberDiff line numberDiff line change
@@ -108,69 +108,17 @@
108108
>
109109
<template #help>
110110
<p>
111-
Mit der HTTP-API kann man den Wert eines MQTT-Topics per HTTPs (Port 8443) abfragen oder neu setzen.
112-
Topics können über GET oder POST abgefragt, neue Werte nur mit POST gesetzt werden.
111+
Mit der HTTP-API kann man den Wert eines MQTT-Topics per HTTPs abfragen oder neu setzen. Die
112+
Schnittstelle ist
113+
<a
114+
href="https://openwb.de/main/wp-content/uploads/2025/02/HTTP-API-fuer-openWB-series1-und-series2.pdf"
115+
target="_blank"
116+
rel="noopener noreferrer"
117+
>
118+
hier
119+
</a>
120+
dokumentiert.
113121
</p>
114-
<p>Beispiel 1: Abfrage des aktuellen Systemzeitstempels</p>
115-
<ul>
116-
<li>
117-
GET-Request:<br />
118-
<openwb-base-copy-to-clipboard
119-
class="text-info"
120-
tooltip="URL kopieren"
121-
>
122-
https://{{ getIpAddress() }}:8443/v1/?topic=openWB/system/time
123-
</openwb-base-copy-to-clipboard>
124-
</li>
125-
<li>
126-
POST-Request über 'curl' mit privatem SSL-Zertifikat und Verarbeitung durch 'jq':<br />
127-
<openwb-base-copy-to-clipboard
128-
class="text-info"
129-
tooltip="Befehl kopieren"
130-
>
131-
curl -k -s -X POST --data '{"topic":"openWB/system/time"}' https://{{ getIpAddress() }}:8443/v1/ |
132-
jq .
133-
</openwb-base-copy-to-clipboard>
134-
</li>
135-
</ul>
136-
<p>Die zurückgegebenen Daten sind im JSON-Format. Der Inhalt ist nach folgendem Schema aufgebaut:</p>
137-
<pre class="border border-info w-100 p-1">{{
138-
JSON.stringify(
139-
{
140-
status: "success",
141-
topic: "openWB/system/time",
142-
message: 1721287000.646975,
143-
},
144-
null,
145-
4,
146-
)
147-
}}</pre>
148-
<p>Im Fehlerfall wird der Status auf "failed" gesetzt und eine Fehlermeldung zurückgegeben.</p>
149-
<p>Beispiel 2: integriertes Display abschalten</p>
150-
<ul>
151-
<li>
152-
POST-Request über 'curl' mit privatem SSL-Zertifikat und Verarbeitung durch 'jq':<br />
153-
<openwb-base-copy-to-clipboard
154-
class="text-info"
155-
tooltip="Befehl kopieren"
156-
>
157-
curl -k -s -X POST --data '{"topic": "openWB/set/optional/int_display/active", "message": false}'
158-
https://{{ getIpAddress() }}:8443/v1/ | jq .
159-
</openwb-base-copy-to-clipboard>
160-
</li>
161-
</ul>
162-
<p>Die zurückgegebenen Daten sind im JSON-Format. Der Inhalt ist nach folgendem Schema aufgebaut:</p>
163-
<pre class="border border-info w-100 p-1">{{
164-
JSON.stringify(
165-
{
166-
status: "success",
167-
topic: "openWB/set/optional/int_display/active",
168-
message: false,
169-
},
170-
null,
171-
4,
172-
)
173-
}}</pre>
174122
</template>
175123
</openwb-base-button-group-input>
176124
</div>

0 commit comments

Comments
 (0)