Esc
Tracklytic
AnleitungenAPI-ReferenzSDKsChangelogTracklytic öffnen

Event senden

Ein POST-Request erstellt ein Event im angegebenen Projekt und Kanal. HTTP 201 mit einem leeren JSON-Objekt bestätigt die Erstellung.

Feldreferenz
curl -X POST https://api.tracklytic.de/v1/event \
  -H "Authorization: Bearer $TRACKLYTIC_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "project": "my-project",
  "channel": "deployments",
  "event": "Deployment abgeschlossen",
  "notify": false
}'
const response = await fetch("https://api.tracklytic.de/v1/event", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRACKLYTIC_API_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "project": "my-project",
  "channel": "deployments",
  "event": "Deployment abgeschlossen",
  "notify": false
})
});
if (!response.ok) throw new Error(await response.text());
import json, os
from urllib.request import Request, urlopen

request = Request("https://api.tracklytic.de/v1/event",
  method="POST",
  headers={"Authorization": "Bearer " + os.environ["TRACKLYTIC_API_TOKEN"],
           "Content-Type": "application/json"},
  data=json.dumps({"project": "my-project", "channel": "deployments",
                   "event": "Deployment abgeschlossen", "notify": False}).encode())
with urlopen(request) as response:
    print(response.status)