Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

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
languagebash
themeDJango
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
showLabelsfalse
max5
spacesFAQ
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("scriptable","user-scripts") and type = "page" and space = "FAQ"
labelsscriptable user-scripts

...