Seitenhistorie
Auszug | ||
---|---|---|
| ||
Erklärung aller Eigenschaften von Events, Formularen und Scripts. |
Events
Events bestehen immer aus dem auslösenden Datensatz und der Art des Ereignis getrennt durch einen Doppelpunkt. Ein Beispiel wäre alarm:create
wobei alarm
sich auf die Alarmierung bezieht und create
auf die Erstellung.
...
Codeblock | ||||
---|---|---|---|---|
| ||||
local fetch = require("fetch") -- Limitierung des Payloads if configuration.onlyTitle then local payload = event.payload.title else local payload = event.payload end -- Datentyp setzen if configuration.format == "json" then local json = require("json") local data = json.encode(event.payload) local contentType = "application/json" elseif configuration.format == "xml" then else print("Ungültiges Datenformat, breche ab.") return -- bricht die Ausführung eines Skripts ab end -- Anfrage senden print(`Sende folgendes {contentType} an {configuration.url}: {data}`) local response = fetch.post(configuration.url, { data = data, contentType = contentType }) print(`Aufruf von "{configuration.url}" endete mit Status-Code {response.status_code}`) |
Beispiel Vorlage
Das komplette Beispiel als importierbares json: Download
Schritt-für-Schritt-Anleitung
...
Verwandte Artikel
Inhalt nach Stichwort | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...